import { Eye, EyeOff, type LucideIcon } from 'lucide-react' import * as React from 'react' import { cn } from '../../utils/cn' export interface InputProps extends React.InputHTMLAttributes { label?: string error?: string helperText?: string errorTestId?: string leftIcon?: LucideIcon rightIcon?: LucideIcon } const Input = React.forwardRef( ( { label, error, helperText, errorTestId, leftIcon: LeftIcon, rightIcon: RightIcon, className, type, disabled, ...props }, ref ) => { const [showPassword, setShowPassword] = React.useState(false) const isPassword = type === 'password' return (
{label && ( )}
{LeftIcon && (
)} {isPassword && ( )} {!isPassword && RightIcon && (
)}
{error && ( )} {helperText && !error && (

{helperText}

)}
) } ) Input.displayName = 'Input' export { Input }