import type { Metadata } from 'next' import { setRequestLocale, getTranslations } from 'next-intl/server' import { redirect } from '@/i18n/navigation' import { getSession } from '@/lib/session' import { getSecurityHistory } from '@/lib/security-history' import { wowAccountLabel } from '@/lib/bnet' import { PageShell } from '@/components/PageShell' import { ServiceBox } from '@/components/ServiceBox' export const dynamic = 'force-dynamic' export const metadata: Metadata = { title: 'Historial de seguridad' } /** Fecha en formato HH:MM:SS DD-MM-YYYY (como el diseño). */ function fmt(d: Date): string { const p = (n: number) => String(n).padStart(2, '0') return `${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())} ${p(d.getDate())}-${p(d.getMonth() + 1)}-${d.getFullYear()}` } /** Celda «Usuario»: cuenta de juego (WOW1) + cuenta Battle.net (email) debajo. */ function UserCell({ label, bnet }: { label: string; bnet: string }) { return (
{t('security.intro1')}
{t('security.intro2')}
{t('security.intro3')}
{t('security.activityTitle')}
{t('security.activityDesc')}
{t('security.realmTitle')}
{t.rich('security.realmDesc', { u: (c) => {c} })}
{t('security.webTitle')}
{t('security.webDesc')}
| {t('security.noActivity')} |
| {t('security.thUser')} | {t('security.thAction')} | IP | {t('security.thDate')} |
|---|---|---|---|
| {a.action} | {a.ip} | {fmt(a.date)} |
| {t('security.noConnections')} |
| IP | {t('security.thDate')} |
|---|---|
| {c.ip} | {fmt(c.date)} |
| {t('security.noConnections')} |
| {t('security.thUser')} | {t('security.thStatus')} | IP | {t('security.thDate')} |
|---|---|---|---|
| {c.status} | {c.ip} | {fmt(c.date)} |