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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user