import { Ionicons } from "@expo/vector-icons"; import React from "react"; import { useTranslation } from "react-i18next"; import { Animated, Pressable, StyleSheet, View } from "react-native"; import { Text } from "@/components/common/Text"; import { useTVFocusAnimation } from "@/components/tv/hooks/useTVFocusAnimation"; import { useScaledTVTypography } from "@/constants/TVTypography"; interface TVGuidePageNavigationProps { currentPage: number; totalPages: number; onPrevious: () => void; onNext: () => void; disabled?: boolean; prevButtonRefSetter?: (ref: View | null) => void; } interface NavButtonProps { onPress: () => void; icon: keyof typeof Ionicons.glyphMap; label: string; isDisabled: boolean; disabled?: boolean; refSetter?: (ref: View | null) => void; } const NavButton: React.FC = ({ onPress, icon, label, isDisabled, disabled = false, refSetter, }) => { const typography = useScaledTVTypography(); const { focused, handleFocus, handleBlur, animatedStyle } = useTVFocusAnimation({ scaleAmount: 1.05, duration: 120, }); const visuallyDisabled = isDisabled || disabled; const handlePress = () => { if (!visuallyDisabled) { onPress(); } }; return ( {label} ); }; export const TVGuidePageNavigation: React.FC = ({ currentPage, totalPages, onPrevious, onNext, disabled = false, prevButtonRefSetter, }) => { const { t } = useTranslation(); const typography = useScaledTVTypography(); return ( = totalPages} disabled={disabled} /> {t("live_tv.page_of", { current: currentPage, total: totalPages })} ); }; const styles = StyleSheet.create({ container: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", paddingVertical: 16, }, buttonsContainer: { flexDirection: "row", alignItems: "center", gap: 12, }, navButton: { flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: 20, paddingVertical: 12, borderRadius: 8, }, navButtonText: { fontWeight: "600", }, pageText: { color: "rgba(255, 255, 255, 0.6)", }, });