import Link from 'next/link' import { TeamFlag } from './team-flag' import { LiveBadge } from './live-badge' interface Team { name: string; iso2?: string | null; slug?: string | null } interface Match { id: number year: number round: string group?: string | null date?: string | null time?: string | null team1: Team team2: Team scoreFt?: number[] | null scoreEt?: number[] | null scoreP?: number[] | null isLive: boolean } function formatDate(d: string) { return new Date(d).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' }) } export function MatchCard({ match, compact = false }: { match: Match; compact?: boolean }) { const ft = match.scoreFt const hasScore = ft != null // Winner: penalties first, then ET, then FT const decisive = match.scoreP ?? match.scoreEt ?? ft const winner = decisive ? (decisive[0] > decisive[1] ? 'home' : decisive[0] < decisive[1] ? 'away' : 'draw') : null if (compact) { return (