import { Pressable, Text, TextInput, View } from "react-native"; import type { PhoneInputProps } from "../../types"; import { usePhoneCountryInput } from "../../hooks/usePhoneCountryInput"; import CountryPickerBottomSheet from "../country-picker/CountryPickerBottomSheet"; import { styles } from "./PhoneInput.styles"; const PhoneInput = ({ value, onChangePhone, label = "Phone", placeholder = "Enter phone number", errorText, disabled = false, wrapperStyle, labelStyle, inputContainerStyle, inputStyle, errorTextStyle, }: PhoneInputProps) => { const { selectedCountry, inputDigits, isCountryModalVisible, setIsCountryModalVisible, handlePhoneChange, handleSelectCountry, } = usePhoneCountryInput({ value, onChangePhone, }); return ( {label ? {label} : null} setIsCountryModalVisible(true)} > {selectedCountry.flag} {selectedCountry?.dialCode} {errorText ? ( {errorText} ) : null} setIsCountryModalVisible(false)} onSelectCountry={handleSelectCountry} /> ); }; export default PhoneInput;