import type { Metadata } from 'next' import { NoteLegend } from '@/components/NoteLegend' import { getTranslations, setRequestLocale } from 'next-intl/server' import { redirect } from '@/i18n/navigation' import { getSession } from '@/lib/session' import { getRestorableCharacters } from '@/lib/restore-character' import { PageShell } from '@/components/PageShell' import { ServiceBox } from '@/components/ServiceBox' import { RestoreCharacterForm } from '@/components/RestoreCharacterForm' export const dynamic = 'force-dynamic' export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise { const { locale } = await params const t = await getTranslations({ locale, namespace: 'CharService' }) return { title: t('restoreChar.pageTitle') } } export default async function RestoreCharacterPage({ params }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const t = await getTranslations('CharService') const session = await getSession() if (!session.bnetId) redirect({ href: '/login', locale }) if (!session.username) redirect({ href: '/select-account', locale }) const chars = await getRestorableCharacters(session.accountId!) return (

{t.rich('restoreChar.intro', { s: (c) => {c} })}


{t('restoreChar.conditions')}

{t('restoreChar.cond1')}

{t('restoreChar.cond2')}

{t.rich('restoreChar.dkHeading', { dk: (c) => {c} })}

{t('restoreChar.dkCond')}


{t('restoreChar.afterRestore')}


{t('restoreChar.noteConditions')}

{t('restoreChar.noteCooldown')}

) }