import React, { useState, useId, InputHTMLAttributes } from "react"; interface FormFieldProps extends Omit, "value" | "onChange"> { title: string; value: string | number; placeholder?: string; handleChangeText: (value: string) => void; } const FormField: React.FC = ({ title, value, placeholder, handleChangeText, type, ...props }) => { const [showPassword, setShowPassword] = useState(false); const inputId = useId(); const isPasswordField = type === "password" || title.toLowerCase().includes("password"); const inputType = isPasswordField ? showPassword ? "text" : "password" : type || "text"; return (
handleChangeText(e.target.value)} className="flex-1 bg-transparent outline-none border-none text-blue-950 text-[16px] font-inherit" {...props} /> {isPasswordField && ( )}
); }; export default FormField;