'use client'; import { EyeIcon, EyeSlashIcon } from '@heroicons/react/24/outline'; import { useTranslations } from 'next-intl'; import { forwardRef, useState } from 'react'; import { Input, type InputProps } from '@/components/ui/input'; import { cn } from '@/lib/utils'; export type PasswordInputProps = Omit; /** * Renders an initially masked input with a translated show/hide toggle. * Forwards the ref and input props to the input; className styles the input, * with right padding reserved for the toggle. Requires a next-intl provider. */ const PasswordInput = forwardRef( ({ className, ...props }, ref) => { const t = useTranslations('PasswordInput'); const [isVisible, setIsVisible] = useState(false); return (
); }, ); PasswordInput.displayName = 'PasswordInput'; export default PasswordInput;