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 ( {title} handleChangeText(e.target.value)} className="flex-1 bg-transparent outline-none border-none text-blue-950 text-[16px] font-inherit" {...props} /> {isPasswordField && ( setShowPassword((prev) => !prev)} aria-pressed={showPassword} aria-label={showPassword ? "Hide password" : "Show password"} className="ml-2 text-gray-600 hover:text-gray-800 focus:outline-none font-montserrat font-medium text-[16px]" > {showPassword ? "Hide" : "Show"} )} ); }; export default FormField;