web-next: rango de cuenta dinámico según PD en /account
La insignia de rango (antes fija a 1_Newbie/Nivel 1) ahora se calcula por los PD de la cuenta: 14 niveles (getAccountRank en lib/account.ts) con umbrales 0/100/200…/900/1000/5000/10000/>10000 → imágenes nw-ranks 1_Newbie…14_GrandMaster y título «Nivel N». Verificado end-to-end: dp=5500 → 12_Mentor «Nivel 12». Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { getTranslations, setRequestLocale } from 'next-intl/server'
|
||||
import { redirect } from '@/i18n/navigation'
|
||||
import { getSession } from '@/lib/session'
|
||||
import { getAccountDashboard } from '@/lib/account'
|
||||
import { getAccountDashboard, getAccountRank } from '@/lib/account'
|
||||
import { isAdmin } from '@/lib/admin'
|
||||
import { PageShell } from '@/components/PageShell'
|
||||
import { AccountTools } from '@/components/AccountTools'
|
||||
@@ -21,6 +21,7 @@ export default async function AccountPage({ params }: { params: Promise<{ locale
|
||||
|
||||
const data = await getAccountDashboard(session)
|
||||
const admin = await isAdmin(session)
|
||||
const rank = getAccountRank(data.dp)
|
||||
|
||||
return (
|
||||
<PageShell title={t('title')}>
|
||||
@@ -47,7 +48,7 @@ export default async function AccountPage({ params }: { params: Promise<{ locale
|
||||
<legend>{t('accountState')}</legend>
|
||||
<div className="separate">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src="/nw-themes/nw-ryu/nw-images/nw-ranks/1_Newbie.svg" className="nw-rank" alt="rank" title={`${t('level')} 1`} />
|
||||
<img src={rank.image} className="nw-rank" alt={`${t('level')} ${rank.level}`} title={`${t('level')} ${rank.level}`} />
|
||||
<p>{t('dp')}: <span>{data.dp}</span></p>
|
||||
<p>{t('vp')}: <span>{data.vp}</span></p>
|
||||
<p>{t('battlepayCredits')}: <span>{data.battlepayCredits}</span></p>
|
||||
|
||||
Reference in New Issue
Block a user