import { apiAtom } from "@/providers/JellyfinProvider"; import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; import { getPrimaryImageUrlById } from "@/utils/jellyfin/image/getPrimaryImageUrlById"; import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { Image } from "expo-image"; import { useAtom } from "jotai"; import { useMemo } from "react"; import { View } from "react-native"; type ArtistPosterProps = { item?: BaseItemDto | null; id?: string | null; showProgress?: boolean; }; const AlbumCover: React.FC = ({ item, id }) => { const [api] = useAtom(apiAtom); const url = useMemo(() => { const u = getPrimaryImageUrl({ api, item, }); return u; }, [item]); const url2 = useMemo(() => { const u = getPrimaryImageUrlById({ api, id, quality: 85, width: 300, }); return u; }, [item]); if (!item && id) return ( ); if (item) return ( ); }; export default AlbumCover;