import * as React from "react"; import { Eye, EyeOff } from "lucide-react"; import { cn } from "../../lib/utils"; import { Button } from "./button"; interface InputProps extends React.ComponentProps<"input"> { showPassword?: boolean; onShowPasswordChange?: (show: boolean) => void; } const Input = React.forwardRef( ( { className, type, showPassword, onShowPasswordChange, value = "", ...props }, ref ) => { const isPassword = type === "password"; const showPasswordToggle = isPassword && onShowPasswordChange; const inputType = isPassword && showPassword ? "text" : type; return (
{showPasswordToggle && ( )}
); } ); Input.displayName = "Input"; export { Input };