import { useState } from 'react' import { Fingerprint, Loader2, Trash2 } from 'lucide-react' import { useTranslation } from 'react-i18next' import { useIntlLocale } from '../../i18n' import { authClient } from '../../lib/auth-client' import { Button } from '../../components/ui' export function PasskeyList({ onRefresh }: { onRefresh: () => void }) { const { data, isPending } = authClient.useListPasskeys() const [deletingId, setDeletingId] = useState(null) const { t } = useTranslation('account') const locale = useIntlLocale() const handleDelete = async (id: string) => { setDeletingId(id) const { error } = await authClient.$fetch('/passkey/delete-passkey', { method: 'POST', body: { id }, }) setDeletingId(null) if (!error) onRefresh() } if (isPending) { return } const passkeys = data ?? [] if (passkeys.length === 0) { return

{t('security.noPasskeys')}

} return ( ) }