import { Pressable, StyleSheet, Text, View } from "react-native"; import PhoneInput, { PhoneInputProps, } from "react-native-international-phone-number"; import DateTimepicker, { AndroidNativeProps, } from "@react-native-community/datetimepicker"; import Icon from "@expo/vector-icons/Ionicons"; import { useState } from "react"; import { TextInput, type TextInputProps } from "react-native"; import { IoniconsType } from "../../lib/types"; import { Input as ReusableInput } from "./../ui/input"; type InputProps = TextInputProps & { ref?: React.RefObject; label?: string; icon?: IoniconsType; right?: React.ReactNode; }; function InputBase({ label, children, right, icon, }: { label?: string; icon?: IoniconsType; children: React.ReactNode; right?: React.ReactNode; }) { return ( {label && {label}} {icon && ( )} {children} {right && ( {right} )} ); } export function Input(args: InputProps) { return ( ); } export function InputPhone(args: PhoneInputProps & { label: string }) { return ( ); } export function InputDateTime( args: AndroidNativeProps & { label: string; icon?: IoniconsType; value?: Date | null; onChange: (event: any, date?: Date) => void; } ) { const [showModal, setShowModal] = useState(false); const displayText = args.value ? args.value.toLocaleDateString("tr-TR") : "Tarih seçiniz"; return ( { setShowModal(true); }} className="p-0 justify-center flex" style={[ styles.dateInput, { backgroundColor: "transparent", borderRadius: 0, height: 48, minHeight: 48, paddingLeft: args.icon ? 28 : 0, // Consistent spacing when icon is present paddingRight: 12, }, ]} > {displayText} {showModal && ( { setShowModal(false); args.onChange(event, date); }} /> )} ); } const styles = StyleSheet.create({ dateInput: { justifyContent: "center", // All other style is now inline for SelectComponent match }, });