fix: update document.title on every page via useEffect

All pages are 'use client' so metadata exports don't work. Each page now
sets document.title via useEffect — static pages with a fixed string,
dynamic pages keyed on data so the title reflects the loaded content.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 19:52:59 +02:00
parent 32d33d2f92
commit 85c40cf56e
8 changed files with 32 additions and 2 deletions
+6
View File
@@ -72,6 +72,12 @@ export default function TournamentPage({ params }: { params: Promise<{ year: str
if (el) el.scrollIntoView({ behavior: 'smooth', block: 'center' })
}, [data])
useEffect(() => {
document.title = data?.tournament
? `${year} World Cup · World Cup`
: `${year} · World Cup`
}, [data, year])
const t = data?.tournament
const standings: Standing[] = data?.groupStandings ?? []
const byGroup = standings.reduce<Record<string, Standing[]>>((acc, s) => {