import { useState } from 'react'; import { Copy, Eye, EyeOff } from 'lucide-react'; import Button from '@/components/elements/Button'; import CopyOnClick from '@/components/elements/CopyOnClick'; import Icon from '@/components/elements/Icon'; import Tooltip from '@/components/elements/tooltip/Tooltip'; import { TextInput } from '@/components/form/controls'; import { useTranslation } from '@/sdk/localization'; interface SecretInputProps { id?: string; value: string | null | undefined; label: string; } const SecretInput = ({ id, value, label }: SecretInputProps) => { const { t } = useTranslation(); const [visible, setVisible] = useState(false); const toggleLabel = visible ? t('Hide {{name}}', { name: label }) : t('Show {{name}}', { name: label }); const copyLabel = t('Copy {{name}}', { name: label }); return (
setVisible((current) => !current)} >
); }; export default SecretInput;