import React, { useRef } from "react"; import { Animated, Pressable, TextInput } from "react-native"; import { Text } from "@/components/common/Text"; import { useScaledTVTypography } from "@/constants/TVTypography"; import { useTVFocusAnimation } from "../hooks/useTVFocusAnimation"; export interface TVSettingsTextInputProps { label: string; value: string; placeholder?: string; onChangeText: (text: string) => void; onBlur?: () => void; secureTextEntry?: boolean; disabled?: boolean; } export const TVSettingsTextInput: React.FC = ({ label, value, placeholder, onChangeText, onBlur, secureTextEntry, disabled, }) => { const typography = useScaledTVTypography(); const inputRef = useRef(null); const { focused, handleFocus, handleBlur, animatedStyle } = useTVFocusAnimation({ scaleAmount: 1.02 }); const handleInputBlur = () => { handleBlur(); onBlur?.(); }; return ( inputRef.current?.focus()} onFocus={handleFocus} onBlur={handleInputBlur} disabled={disabled} focusable={!disabled} > {label} ); };