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 { getGameCharacters } from '@/lib/characters' import { QUEST_OPTIONS } from '@/lib/quest-tracker' import { wowheadIcon, wowheadUrl, wowheadData, wowheadWotlkHome, type WowheadType } from '@/lib/wowhead' import { PageShell } from '@/components/PageShell' import { ServiceBox } from '@/components/ServiceBox' import { QuestTrackerForm } from '@/components/QuestTrackerForm' 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('quest.pageTitle') } } const CLASS_GROUPS: { css: string; name: string }[] = [ { css: 'warlock', name: 'Brujo' }, { css: 'hunter', name: 'Cazador' }, { css: 'shaman', name: 'Chamán' }, { css: 'druid', name: 'Druida' }, { css: 'warrior', name: 'Guerrero' }, { css: 'paladin', name: 'Paladín' }, ] export default async function QuestCharacterPage({ 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: '/log-in', locale }) if (!session.username) redirect({ href: '/select-account', locale }) const chars = await getGameCharacters(session.accountId!) const clientOptions = QUEST_OPTIONS.map((o) => ({ key: o.key, classCss: o.classCss, label: o.label, minLevel: o.minLevel, hasData: o.quests.length > 0, })) return (

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


{t('quest.optionsAvailable')}

{CLASS_GROUPS.map((g) => { const opts = QUEST_OPTIONS.filter((o) => o.classCss === g.css) if (opts.length === 0) return null return (

{t(`quest.className.${g.css}`)}

    {opts.map((o) => (
  • {o.link ? ( {o.label} ) : ( o.label )}{' '} {t('quest.fromLevel', { level: o.minLevel })}
  • ))}

) })}

{t('quest.byReputation')}

  • {t.rich('quest.hodir', { hodir: (c) => {c}, lille: (c) => {c}, })}

{t('quest.bySpecific')}

  • {t('quest.fromLevel10')}

{t('quest.howToSearch')}

{t.rich('quest.step1', { link: (c) => {c} })}

{t('quest.step2')}

{t.rich('quest.step3', { url: wowheadWotlkHome(locale), s: (c) => {c} })}

{t('quest.step4')}


{t('quest.searchButtonExplain')}


{t('quest.noteOffline')}

{t('quest.noteChain1h')}

{t('quest.noteClass30')}

{t('quest.noteSpecific10')}

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