import { Eye, EyeOff } from "lucide-react"; import React, { useState } from "react"; import { Input } from "../form-fields/input"; import { cn } from "../utils"; export interface AuthInputProps extends Omit, "autoComplete"> { label?: string; error?: string; showPasswordToggle?: boolean; errorClassName?: string; autoComplete?: "on" | "off"; } const baseContainerClassName = "flex flex-col gap-1.5"; export const AuthInput: React.FC = ({ label, error, showPasswordToggle = false, errorClassName = "", className = "", type = "text", ...props }) => { const { id } = props; const [showPassword, setShowPassword] = useState(false); const isPasswordType = type === "password"; const inputType = isPasswordType && showPasswordToggle && showPassword ? "text" : type; return (
{label && ( )}
{showPasswordToggle && isPasswordType && ( )}
{error &&

{error}

}
); };