import type { Metadata } from 'next' import { getTranslations, setRequestLocale } from 'next-intl/server' import { redirect } from '@/i18n/navigation' import { getSession } from '@/lib/session' import { getGameCharacters } from '@/lib/characters' import { getDPointsBalance } from '@/lib/dpoints' import { getCustomizePrice } from '@/lib/prices' import { PageShell } from '@/components/PageShell' import { ServiceBox } from '@/components/ServiceBox' import { PaidServiceForm } from '@/components/PaidServiceForm' 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: 'CharServiceB.customize' }) return { title: t('title') } } export default async function CustomizeCharacterPage({ params }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const session = await getSession() if (!session.bnetId) redirect({ href: '/log-in', locale }) if (!session.username) redirect({ href: '/select-account', locale }) const [chars, price, pdBalance] = await Promise.all([ getGameCharacters(session.accountId!), getCustomizePrice(), getDPointsBalance(session.accountId!), ]) const t = await getTranslations('CharServiceB.customize') return (

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

{t('aspect1')}

{t('aspect2')}

{t('aspect3')}

{t('aspect4')}

{t('aspect5')}

{t('alsoRename')}


{t('instructions')}

{t('iconInfo')}

{t('iconClick')}


{t('noteLegend')}

{t('noteConfirm')}



{t.rich('requires', { price, s: (c) => {c}, y: (c) => {c} })}

({ name: c.name, classCss: c.classCss }))} checkoutEndpoint="/api/character/customize/checkout" payLabel={t('payLabel')} buttonClass="customize-button" priceEur={price} pdBalance={pdBalance} />
) }