mirror of
https://github.com/streamyfin/streamyfin.git
synced 2025-08-20 18:37:18 +02:00
52 lines
988 B
TypeScript
52 lines
988 B
TypeScript
import { Image } from "expo-image";
|
|
import { View } from "react-native";
|
|
|
|
type PosterProps = {
|
|
id?: string | null;
|
|
url?: string | null;
|
|
showProgress?: boolean;
|
|
blurhash?: string | null;
|
|
};
|
|
|
|
const Poster: React.FC<PosterProps> = ({ id, url, blurhash }) => {
|
|
if (!id && !url)
|
|
return (
|
|
<View
|
|
className='border border-neutral-900'
|
|
style={{
|
|
aspectRatio: "10/15",
|
|
}}
|
|
/>
|
|
);
|
|
|
|
return (
|
|
<View className='rounded-lg overflow-hidden border border-neutral-900'>
|
|
<Image
|
|
placeholder={
|
|
blurhash
|
|
? {
|
|
blurhash,
|
|
}
|
|
: null
|
|
}
|
|
key={id}
|
|
id={id!}
|
|
source={
|
|
url
|
|
? {
|
|
uri: url,
|
|
}
|
|
: null
|
|
}
|
|
cachePolicy={"memory-disk"}
|
|
contentFit='cover'
|
|
style={{
|
|
aspectRatio: "10/15",
|
|
}}
|
|
/>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
export default Poster;
|