'use client' import { useQuery, gql } from '@/lib/graphql/hooks' import { useEffect } from 'react' import Link from 'next/link' import { TeamFlag } from '@/components/team-flag' const GROUPS_QUERY = gql` query Groups { groupStandings(year: 2026) { groupName pos played won drawn lost goalsFor goalsAgainst goalDiff pts team { id name iso2 slug } } } ` interface Standing { groupName: string; pos?: number | null played: number; won: number; drawn: number; lost: number goalsFor: number; goalsAgainst: number; goalDiff: number; pts: number team: { id: number; name: string; iso2?: string | null; slug: string } } export default function GroupsPage() { const { data, loading } = useQuery(GROUPS_QUERY, { pollInterval: 60_000 }) useEffect(() => { document.title = 'Group Stage · World Cup' }, []) const standings: Standing[] = data?.groupStandings ?? [] const byGroup = standings.reduce>((acc, s) => { acc[s.groupName] = [...(acc[s.groupName] ?? []), s] return acc }, {}) const groups = Object.entries(byGroup).sort(([a], [b]) => a.localeCompare(b)) return (

2026 Groups

48 teams · 12 groups · Top 2 + 8 best 3rd-place advance

{loading && !data && (
{Array.from({ length: 12 }).map((_, i) => (
))}
)}
{groups.map(([groupName, rows]) => { const sorted = [...rows].sort((a, b) => { if (b.pts !== a.pts) return b.pts - a.pts if (b.goalDiff !== a.goalDiff) return b.goalDiff - a.goalDiff return b.goalsFor - a.goalsFor }) const letter = groupName.replace('Group ', '') return (
GROUP {letter}
Team PW DL GDPts
{sorted.map((t, idx) => (
{t.team.name}
{[t.played, t.won, t.drawn, t.lost].map((v, i) => ( {v} ))} {t.goalDiff > 0 ? `+${t.goalDiff}` : t.goalDiff} {t.pts}
))}
) })}
) }