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:
@@ -41,6 +41,10 @@ function SearchContent() {
|
||||
return () => clearTimeout(t)
|
||||
}, [q, router])
|
||||
|
||||
useEffect(() => {
|
||||
document.title = q.trim() ? `"${q.trim()}" · World Cup` : 'Search · World Cup'
|
||||
}, [q])
|
||||
|
||||
const skip = debouncedQ.trim().length < 2
|
||||
const { data, loading } = useQuery(SEARCH_QUERY, {
|
||||
variables: { q: debouncedQ },
|
||||
|
||||
Reference in New Issue
Block a user