a9ae6d4506
La página del reino pasa de /novawow-realm (fija) a una ruta dinámica app/[locale]/[realm] cuyo slug es <nombre-del-reino>-realm, con el nombre tomado de acore_auth.realmlist (LIMIT 1). Ej.: realm «Trinity» → /trinity-realm. realmSlug() normaliza el nombre (minúsculas, sin espacios). Si el slug no coincide con el reino actual → notFound(). Convive con el catch-all [...rest] y las rutas estáticas mantienen prioridad (verificado: /login, /account OK; /foo y /novawow-realm → 404). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
71 lines
2.6 KiB
TypeScript
71 lines
2.6 KiB
TypeScript
import type { Metadata } from 'next'
|
|
import { setRequestLocale } from 'next-intl/server'
|
|
import { notFound } from 'next/navigation'
|
|
import { getRealmName, realmSlug } from '@/lib/realm'
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
|
|
// Ruta dinámica del reino: /<slug>-realm, donde <slug> viene del nombre del
|
|
// reino en acore_auth.realmlist (p. ej. «Trinity» → /trinity-realm).
|
|
async function resolveRealm(param: string): Promise<string | null> {
|
|
const name = await getRealmName()
|
|
return param === `${realmSlug(name)}-realm` ? name : null
|
|
}
|
|
|
|
export async function generateMetadata({
|
|
params,
|
|
}: {
|
|
params: Promise<{ realm: string }>
|
|
}): Promise<Metadata> {
|
|
const { realm } = await params
|
|
const name = await resolveRealm(realm)
|
|
return name ? { title: `Reino - ${name}` } : {}
|
|
}
|
|
|
|
export default async function RealmPage({
|
|
params,
|
|
}: {
|
|
params: Promise<{ locale: string; realm: string }>
|
|
}) {
|
|
const { locale, realm } = await params
|
|
setRequestLocale(locale)
|
|
const name = await resolveRealm(realm)
|
|
if (!name) notFound()
|
|
|
|
return (
|
|
<div className="main-page">
|
|
<div className="middle-content">
|
|
<div className="body-content">
|
|
<div className="title-content">
|
|
<h1>Reino - <span className="blue-info">{name.toUpperCase()}</span></h1>
|
|
</div>
|
|
<div className="box-content centered">
|
|
<div className="realm-information realm-information-half">
|
|
<h2>Rates</h2>
|
|
<p>Experiencia: <span>x8 modificable con .xp (Con Recluta a un Amigo x16)</span></p>
|
|
<p>Drop de objetos verdes y azules: <span>x4</span></p>
|
|
<p>Drop de oro en NPCs: <span>x2</span></p>
|
|
<p>Drop de oro en misiones: <span>x1</span></p>
|
|
<p>Habilidades: <span>x3</span></p>
|
|
<p>Profesiones: <span>x3</span></p>
|
|
<p>Reputaciones: <span>x3 (Bonus con Recluta a un amigo)</span></p>
|
|
<p>Honor: <span>x3</span></p>
|
|
</div>
|
|
<div className="realm-information realm-information-half">
|
|
<h2>Horarios</h2>
|
|
<p>Los siguientes horarios son basados en la hora del reino.</p>
|
|
<br />
|
|
<p>Misiones diarias: <span>7 am</span></p>
|
|
<p>Reinicio de mazmorras diarias: <span>9 am</span></p>
|
|
<p>Reinicio de bandas: <span>9 am (Miércoles)</span></p>
|
|
<p>Campos de Batalla: <span>10 am</span></p>
|
|
<p>Reparto de Puntos de Arena: <span>11 am (Viernes)</span></p>
|
|
<br />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|