import {useState} from "react"; interface Props { type: "email" | "text" | "password"; required?: boolean; label?: string; placeholder?: string; name: string; onChange: (value: string) => void; } export default function Input({type, label, placeholder, name, required = false, onChange}: Props) { const [showPassword, setShowPassword] = useState(false); if (type === "password") { return (
{label && ( )}
onChange(e.target.value)} placeholder={placeholder} className="w-full px-8 py-6 text-sm font-normal placeholder:text-mti-gray-cool bg-white rounded-full border border-mti-gray-platinum focus:outline-none" />

setShowPassword((prev) => !prev)} className="text-xs cursor-pointer absolute bottom-1/2 translate-y-1/2 right-8"> {showPassword ? "Hide" : "Show"}

); } return (
{label && ( )} onChange(e.target.value)} placeholder={placeholder} className="px-8 py-6 text-sm font-normal placeholder:text-mti-gray-cool bg-white rounded-full border border-mti-gray-platinum focus:outline-none" required={required} />
); }