import { Ionicons } from "@expo/vector-icons"; import React from "react"; import { Animated, Pressable, StyleSheet, View } from "react-native"; import { Text } from "@/components/common/Text"; import { useScaledTVTypography } from "@/constants/TVTypography"; import { scaleSize } from "@/utils/scaleSize"; import { useTVFocusAnimation } from "./hooks/useTVFocusAnimation"; export interface TVLanguageCardProps { code: string; name: string; selected: boolean; hasTVPreferredFocus?: boolean; onPress: () => void; } export const TVLanguageCard = React.forwardRef( ({ code, name, selected, hasTVPreferredFocus, onPress }, ref) => { const typography = useScaledTVTypography(); const styles = createStyles(typography); const { focused, handleFocus, handleBlur, animatedStyle } = useTVFocusAnimation({ scaleAmount: 1.05 }); return ( {name} {code.toUpperCase()} {selected && !focused && ( )} ); }, ); const createStyles = (typography: ReturnType) => StyleSheet.create({ languageCard: { width: scaleSize(120), height: scaleSize(60), borderRadius: scaleSize(12), justifyContent: "center", alignItems: "center", paddingHorizontal: scaleSize(12), }, languageCardText: { fontSize: typography.callout, fontWeight: "500", }, languageCardCode: { fontSize: typography.callout, marginTop: scaleSize(2), }, checkmark: { position: "absolute", top: scaleSize(8), right: scaleSize(8), }, });