'use client' import { useState } from 'react' interface PasswordInputProps { value: string onChange: (value: string) => void label?: string placeholder?: string error?: string | null disabled?: boolean required?: boolean className?: string id?: string autoComplete?: string minLength?: number onFocus?: () => void onBlur?: () => void } export default function PasswordInput({ value, onChange, label = 'Password', placeholder = 'Enter password', error, disabled = false, required = false, className = '', id, autoComplete, minLength, onFocus, onBlur }: PasswordInputProps) { const [showPassword, setShowPassword] = useState(false) const inputId = id || 'password-input' const errorId = `${inputId}-error` return (
{label && ( )}
onChange(e.target.value)} placeholder={placeholder} disabled={disabled} autoComplete={autoComplete} minLength={minLength} onFocus={onFocus} onBlur={onBlur} aria-invalid={!!error} aria-describedby={error ? errorId : undefined} className={`w-full pl-11 pr-12 py-3 border rounded-xl bg-neutral-50/50 dark:bg-neutral-900/50 focus:bg-white dark:focus:bg-neutral-900 transition-all duration-200 outline-none disabled:opacity-50 disabled:cursor-not-allowed dark:text-white ${error ? 'border-red-300 dark:border-red-800 focus:border-red-500 focus:ring-4 focus:ring-red-500/10' : 'border-neutral-200 dark:border-neutral-800 hover:border-brand-orange/50 focus:border-brand-orange focus:ring-4 focus:ring-brand-orange/10' }`} /> {/* Lock Icon (Left) */}
{/* Toggle Visibility Button (Right) */}
{error && ( )}
) }