import React, { useState } from 'react'; import { View, TextInput, Text, StyleSheet, ViewStyle, TouchableOpacity, Platform } from 'react-native'; import { useAppTheme } from '../context/ThemeContext'; import { Feather } from '@expo/vector-icons'; interface InputProps { label?: string; placeholder?: string; value: string; onChangeText: (text: string) => void; secureTextEntry?: boolean; style?: ViewStyle; keyboardType?: 'default' | 'email-address' | 'numeric' | 'phone-pad'; multiline?: boolean; required?: boolean; infoText?: string; } const LIME = '#C6F135'; export const Input: React.FC = ({ label, placeholder, value, onChangeText, secureTextEntry, style, keyboardType = 'default', multiline = false, required = false, infoText }) => { const { colors, isDark } = useAppTheme(); const [isFocused, setIsFocused] = useState(false); const [isPasswordVisible, setIsPasswordVisible] = useState(false); const handleFocus = () => setIsFocused(true); const handleBlur = () => setIsFocused(false); const isSecure = secureTextEntry && !isPasswordVisible; const bg = isDark ? '#1A1A1A' : '#F5F5F5'; const border = isDark ? '#2A2A2A' : '#EEEEEE'; return ( {label && ( {label} {required && *} )} {secureTextEntry && ( setIsPasswordVisible(!isPasswordVisible)} > )} {infoText && {infoText}} ); }; const styles = StyleSheet.create({ container: { marginBottom: 18, width: '100%', }, labelRow: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'flex-end', marginBottom: 8, }, label: { fontSize: 11, fontFamily: 'Outfit_700Bold', letterSpacing: 1, textTransform: 'uppercase', }, inputWrapper: { height: 56, borderRadius: 14, paddingLeft: 16, borderWidth: 1.5, flexDirection: 'row', alignItems: 'center', }, input: { flex: 1, fontSize: 15, fontFamily: 'Outfit_500Medium', height: '100%', }, eyeIcon: { position: 'absolute', right: 15, height: '100%', justifyContent: 'center', paddingHorizontal: 5, }, infoText: { fontSize: 12, marginTop: 6, marginLeft: 4, fontFamily: 'Outfit_400Regular', }, });