/** * Player-agnostic "next episode" countdown card. The parent owns the timer and * positioning — this component only renders the next episode's poster, title, * the remaining seconds, and the Play-now / Cancel actions. */ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { Image } from "expo-image"; import { useTranslation } from "react-i18next"; import { Pressable, View } from "react-native"; import { Text } from "@/components/common/Text"; interface AutoplayCountdownProps { /** The episode that will play next. */ nextEpisode: BaseItemDto; /** Poster image URL for the next episode, or null. */ posterUrl: string | null; /** Seconds left before the next episode plays. */ secondsRemaining: number; /** Play the next episode immediately. */ onPlayNow: () => void; /** Cancel autoplay — the next episode will not play. */ onCancel: () => void; } export function AutoplayCountdown({ nextEpisode, posterUrl, secondsRemaining, onPlayNow, onCancel, }: AutoplayCountdownProps) { const { t } = useTranslation(); return ( {posterUrl && ( )} {t("player.up_next")} {nextEpisode.Name} {t("player.next_episode_in", { seconds: secondsRemaining })} {t("player.play_now")} {t("player.cancel")} ); }