import { useRef, useState } from "react"; import { Animated, Easing, Platform, Pressable, TextInput, type TextInputProps, View, } from "react-native"; interface InputProps extends TextInputProps { extraClassName?: string; } export function Input(props: InputProps) { const { style, extraClassName = "", ...otherProps } = props; const inputRef = useRef(null); const [isFocused, setIsFocused] = useState(false); const scale = useRef(new Animated.Value(1)).current; const animateFocus = (focused: boolean) => { Animated.timing(scale, { toValue: focused ? 1.02 : 1, duration: 150, easing: Easing.out(Easing.quad), useNativeDriver: true, }).start(); }; const handleFocus = () => { setIsFocused(true); animateFocus(true); }; const handleBlur = () => { setIsFocused(false); animateFocus(false); }; if (Platform.isTV) { return ( inputRef.current?.focus()} onFocus={handleFocus} onBlur={handleBlur} > {/* Outer glow when focused */} {isFocused && ( )} {/* Purple accent bar at top when focused */} {isFocused && ( )} ); } // Mobile version unchanged return ( ); }