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 { getChangeFactionPrice } 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.changeFaction' }) return { title: t('title') } } const GOLD_ICON = '/nw-themes/nw-ryu/nw-images/nw-icons/money-gold.gif' function GoldCell({ amount }: { amount: number }) { return ( {amount} {/* eslint-disable-next-line @next/next/no-img-element */} oro ) } export default async function ChangeFactionCharacterPage({ 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] = await Promise.all([getGameCharacters(session.accountId!), getChangeFactionPrice()]) const t = await getTranslations('CharServiceB.changeFaction') return (

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

{t('alsoRename')}


{t('onChange')}

{t('change1')}

{t('change2')}

{t('change3')}

{t('change4')}


{t('restrictionsTitle')}

{t('restriction1')}

{t('restriction2')}

{t('restriction3')}

{t('restriction4')}

{t('restriction5')}


{t('tableLevel')} {t('tableMaxGold')}
10-30
31-50
51-70
71-80

{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/change-faction/checkout" payLabel={t('payLabel')} buttonClass="change-faction-button" provider="sumup" confirmText={t('confirm', { price })} />
) }