import { Text } from "@/components/common/Text"; import MoviePoster from "@/components/posters/MoviePoster"; import { useSettings } from "@/utils/atoms/settings"; import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { useQuery, type QueryFunction, type QueryKey, } from "@tanstack/react-query"; import { View, ViewProps } from "react-native"; import ContinueWatchingPoster from "../ContinueWatchingPoster"; import { ItemCardText } from "../ItemCardText"; import { HorizontalScroll } from "../common/HorrizontalScroll"; import { TouchableItemRouter } from "../common/TouchableItemRouter"; import SeriesPoster from "../posters/SeriesPoster"; interface Props extends ViewProps { title?: string | null; orientation?: "horizontal" | "vertical"; height?: "small" | "large"; disabled?: boolean; queryKey: QueryKey; queryFn: QueryFunction; } export const ScrollingCollectionList: React.FC = ({ title, orientation = "vertical", height = "small", disabled = false, queryFn, queryKey, ...props }) => { const [settings] = useSettings(); const { data, isLoading } = useQuery({ queryKey, queryFn, enabled: !disabled, staleTime: 60 * 1000, }); if (disabled || !title) return null; return ( {title} ( {item.Type === "Episode" && orientation === "horizontal" && ( )} {item.Type === "Episode" && orientation === "vertical" && ( )} {item.Type === "Movie" && orientation === "horizontal" && ( )} {item.Type === "Movie" && orientation === "vertical" && ( )} {item.Type === "Series" && } )} /> ); };