From 82d093fbb4063bb840a47ab03f4905102bf35052 Mon Sep 17 00:00:00 2001 From: Andreas Knuth Date: Tue, 23 Jun 2026 15:56:11 -0500 Subject: [PATCH] fixes --- app/api/matches/route.ts | 4 +++- app/components/Groups.tsx | 17 ++++++++++++++++- app/globals.css | 10 +++++++++- app/page.tsx | 39 ++++++++++++++++++++------------------- 4 files changed, 48 insertions(+), 22 deletions(-) diff --git a/app/api/matches/route.ts b/app/api/matches/route.ts index 5ec33fc..acba804 100644 --- a/app/api/matches/route.ts +++ b/app/api/matches/route.ts @@ -21,7 +21,8 @@ export async function GET() { } const groupTables = computeGroupTables(teams, matches); - const thirdTable = computeThirdPlaceTable(groupTables); + const groupTablesLive = computeGroupTables(teams, matches, true); + const thirdTable = computeThirdPlaceTable(groupTablesLive); const qGroups = qualifiedThirdGroups(thirdTable); const annex = qGroups.length === 8 ? resolveAnnexC(qGroups) : null; @@ -30,6 +31,7 @@ export async function GET() { teams, matches, groupTables, + groupTablesLive, thirdTable, annexAssignment: annex, annexResolved: annex != null, diff --git a/app/components/Groups.tsx b/app/components/Groups.tsx index 1a52d36..be5d06a 100644 --- a/app/components/Groups.tsx +++ b/app/components/Groups.tsx @@ -13,6 +13,18 @@ function liveMatchFor(group: string, matches: Match[]) { ); } +function liveTeamIdsFor(group: GroupId, matches: Match[]): Set { + const ids = new Set(); + for (const m of matches) { + if (m.group !== group) continue; + if (m.status === "LIVE" || m.status === "IN_PLAY" || m.status === "PAUSED") { + if (m.homeTeamId) ids.add(m.homeTeamId); + if (m.awayTeamId) ids.add(m.awayTeamId); + } + } + return ids; +} + export default function Groups({ tables, teams, matches, onOpenGroup, }: { @@ -23,6 +35,7 @@ export default function Groups({
{tables.map((t) => { const live = liveMatchFor(t.group, matches); + const liveIds = liveTeamIdsFor(t.group, matches); return (
+ + + +
-
{error && ( @@ -112,7 +113,7 @@ export default function Home() { {data && tab === "groups" && ( )} @@ -127,7 +128,7 @@ export default function Home() { )} {data && tab === "bracket" && (