From 2e284ec49ecbab4ec7641e8d124d67b684f7c2b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 14 Jun 2026 19:39:01 +0200 Subject: [PATCH] fix: show penalty score as headline result, FT score as footnote MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For shootout games the FT score (e.g. 2–2) was the main display, which was misleading. Now the penalty score is the headline (4–2) with "2–2 a.e.t." below it. Winner highlighting also uses the penalty score. Co-Authored-By: Claude Sonnet 4.6 --- components/match-card.tsx | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/components/match-card.tsx b/components/match-card.tsx index 78abf3b..8016c2f 100644 --- a/components/match-card.tsx +++ b/components/match-card.tsx @@ -25,7 +25,9 @@ function formatDate(d: string) { export function MatchCard({ match, compact = false }: { match: Match; compact?: boolean }) { const ft = match.scoreFt const hasScore = ft != null - const winner = ft ? (ft[0] > ft[1] ? 'home' : ft[0] < ft[1] ? 'away' : 'draw') : null + // Penalty score determines the winner when present + const decisive = match.scoreP ?? ft + const winner = decisive ? (decisive[0] > decisive[1] ? 'home' : decisive[0] < decisive[1] ? 'away' : 'draw') : null if (compact) { return ( @@ -41,8 +43,19 @@ export function MatchCard({ match, compact = false }: { match: Match; compact?: {match.team1.name} -
- {hasScore ? `${ft![0]} – ${ft![1]}` : match.isLive ? : '–'} +
+
+ {hasScore + ? match.scoreP + ? `${match.scoreP[0]} – ${match.scoreP[1]}` + : `${ft![0]} – ${ft![1]}` + : match.isLive ? : '–'} +
+ {match.scoreP && ( +
+ {ft![0]}–{ft![1]} a.e.t. +
+ )}
@@ -51,7 +64,9 @@ export function MatchCard({ match, compact = false }: { match: Match; compact?:
- {match.scoreEt &&
AET · {match.scoreP ? `PSO ${match.scoreP[0]}-${match.scoreP[1]}` : ''}
} + {match.scoreEt && !match.scoreP && ( +
a.e.t.
+ )} ) @@ -68,12 +83,20 @@ export function MatchCard({ match, compact = false }: { match: Match; compact?:
- {hasScore ? `${ft![0]} – ${ft![1]}` : '? – ?'} + {hasScore + ? match.scoreP + ? `${match.scoreP[0]} – ${match.scoreP[1]}` + : `${ft![0]} – ${ft![1]}` + : '? – ?'}
+ {match.scoreP && ( +
{ft![0]}–{ft![1]} a.e.t.
+ )}
{match.round}
{match.date ? formatDate(match.date) : ''}
- {match.scoreEt &&
AET {match.scoreEt[0]}–{match.scoreEt[1]}
} - {match.scoreP &&
PSO {match.scoreP[0]}–{match.scoreP[1]}
} + {match.scoreEt && !match.scoreP && ( +
a.e.t. {match.scoreEt[0]}–{match.scoreEt[1]}
+ )}