feat(i18n): traducir perfil y seguridad

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jose Selesan
2026-11-03 14:00:14 -03:00
parent dfb6951d7c
commit 243530fab2
13 changed files with 149 additions and 26 deletions

View File

@@ -1,11 +1,15 @@
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<string | null>(null)
const { t } = useTranslation('account')
const locale = useIntlLocale()
const handleDelete = async (id: string) => {
setDeletingId(id)
@@ -23,7 +27,7 @@ export function PasskeyList({ onRefresh }: { onRefresh: () => void }) {
const passkeys = data ?? []
if (passkeys.length === 0) {
return <p className="text-sm text-foreground/60">Todavía no registraste ninguna passkey.</p>
return <p className="text-sm text-foreground/60">{t('security.noPasskeys')}</p>
}
return (
@@ -36,14 +40,14 @@ export function PasskeyList({ onRefresh }: { onRefresh: () => void }) {
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-primary">{passkey.name ?? 'Passkey'}</p>
<p className="text-xs text-foreground/50">
{passkey.deviceType === 'singleDevice' ? 'Dispositivo' : 'Llave de seguridad'} ·{' '}
{new Date(passkey.createdAt).toLocaleDateString('es-AR')}
{passkey.deviceType === 'singleDevice' ? t('security.device') : t('security.securityKey')} ·{' '}
{new Date(passkey.createdAt).toLocaleDateString(locale)}
</p>
</div>
<Button
size="icon"
variant="ghost"
aria-label="Eliminar passkey"
aria-label={t('security.deletePasskey')}
disabled={deletingId === passkey.id}
onClick={() => void handleDelete(passkey.id)}
>