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 { getGoldOptions } from '@/lib/prices' import { PageShell } from '@/components/PageShell' import { ServiceBox } from '@/components/ServiceBox' import { GoldForm } from '@/components/GoldForm' 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.gold' }) return { title: t('title') } } const GOLD_ICON = '/nw-themes/nw-ryu/nw-images/nw-icons/money-gold.gif' export default async function GoldCharacterPage({ 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, options, pdBalance] = await Promise.all([ getGameCharacters(session.accountId!), getGoldOptions(), getDPointsBalance(session.accountId!), ]) const t = await getTranslations('CharServiceB.gold') return (

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


{t('instructions')}

{t('mailInfo')}


{t('noteLegend')}

{t('noteConfirm')}



{t('requiresLabel')}

{options.map((o) => ( ))}
{o.gold_amount} {/* eslint-disable-next-line @next/next/no-img-element */} oro = {o.price}

({ name: c.name, classCss: c.classCss }))} options={options} pdBalance={pdBalance} />
) }