import { apiAtom } from "@/providers/JellyfinProvider"; import { getPrimaryImageById } from "@/utils/jellyfin"; import { useQuery } from "@tanstack/react-query"; import { Image } from "expo-image"; import { useAtom } from "jotai"; import { View } from "react-native"; type PosterProps = { itemId?: string | null; showProgress?: boolean; }; const Poster: React.FC = ({ itemId }) => { const [api] = useAtom(apiAtom); const { data: url } = useQuery({ queryKey: ["backdrop", itemId], queryFn: async () => getPrimaryImageById(api, itemId), enabled: !!api && !!itemId, staleTime: Infinity, }); if (!url || !itemId) return ( ); return ( ); }; export default Poster;