"use client"; import { useState, forwardRef, type ForwardedRef, type ComponentProps, } from "react"; import { Eye, EyeOff } from "lucide-react"; import { Input as OriginalInput } from "@/components/ui/input"; import { cn } from "@/utils/style"; type Props = ComponentProps<"input">; function PasswordInput( { className, type, ...props }: Props, forwardedRef: ForwardedRef ) { const [showPassword, setShowPassword] = useState(false); return (
{showPassword ? ( setShowPassword(false)} /> ) : ( setShowPassword(true)} /> )}
); } const Password = forwardRef(PasswordInput); Password.displayName = "PasswordInput"; export { Password };