/* soccerarena.ai โ€” award detail page body (winner / golden boot / ball / glove). */ function preLabel(startDate) { const days = Math.ceil((new Date(startDate + 'T00:00:00Z') - Date.now()) / 86400000); return days > 0 ? `T-${days}` : 'PRE-TOURNAMENT'; } const ALL_AWARDS = [ { key: 'winner', label: 'Tournament Winner', emoji: '๐Ÿ†', slug: 'winner' }, { key: 'goldenBoot', label: 'Golden Boot', emoji: 'โšฝ', slug: 'golden-boot' }, { key: 'goldenBall', label: 'Golden Ball', emoji: '๐ŸŒŸ', slug: 'golden-ball' }, { key: 'goldenGlove', label: 'Golden Glove', emoji: '๐Ÿงค', slug: 'golden-glove' }, ]; function AwardPage({ awardKey }) { const award = ARENA.awards[awardKey]; const isMobile = useIsMobile(); const isWinner = awardKey === 'winner'; const n = award.models.length; const pickChip = (p, size = 14, link = null) => { const inner = ( {p && p.flag && {p.flag}} {p ? p.name : 'โ€”'} ); return link ? {inner} : {inner}; }; const teamHref = (pick) => pick && pick.name && pick.name !== 'โ€”' ? SA_ROOT + 'teams/' + toSlug(pick.name) + '.html' : null; const modelCols = isWinner ? (isMobile ? '1.4fr 1fr 80px' : '1.4fr 1.2fr 96px') : (isMobile ? '1.4fr 1fr' : '1.4fr 1fr'); const withFlips = isWinner ? award.models.filter(m => m.history && m.history.length > 1) : []; return (
{/* hero */}
{award.emoji}
TRACK 1 ยท {preLabel(ARENA.tournament.startDate)}

{award.label}

{award.topPick.flag && {award.topPick.flag}} {isWinner && award.topPick.name && award.topPick.name !== 'โ€”' ? {award.topPick.name} : {award.topPick.name} }
{award.topPick.count} / {award.topPick.total} models
consensus pick
{/* body */}
{/* left */}
{/* per-model table */}
MODEL PICK {isWinner && CONFIDENCE}
{award.models.map((m, i) => (
{m.name} {isWinner && m.history && m.history.length > 1 && }
{m.pick && m.pick.flag && {m.pick.flag}} {isWinner && m.pick && m.pick.name && m.pick.name !== 'โ€”' ? {m.pick.name} : {m.pick ? m.pick.name : 'โ€”'} }
{isWinner && (
{Math.round((m.conf || 0) * 100)}%
)}
))}
{/* trend across days */} {award.trend.length > 1 && (
{[...award.trend].reverse().map((t, i) => (
{t.date}
{t.topPick.flag && {t.topPick.flag}} {t.topPick.name} {t.topPick.count}/{t.total}
))}
)} {/* winner: per-model flip history */} {isWinner && ( 0 ? `${withFlips.length} model${withFlips.length > 1 ? 's' : ''} flipped` : 'no changes yet'}> {withFlips.length === 0 ? (

No models have changed their winner pick yet. Changes will appear here as the tournament progresses.

) : (
{withFlips.map((m, mi) => (
{m.name} {m.history.length} changes
{m.history.map((e, ei) => (
D{e.day} {ei < m.history.length - 1 && }
{pickChip(e.pick, 13, teamHref(e.pick))}
{e.note &&
{e.note}
}
))}
))}
)}
)}
{/* right */}
{/* vote distribution */}
{award.tally.map((t, i) => (
{t.pick.flag && {t.pick.flag}} {isWinner && t.pick.name && t.pick.name !== 'โ€”' ? {t.pick.name} : {t.pick.name} }
{t.count} / {n}
))}
{/* links to other award pages */} {ALL_AWARDS.filter(a => a.key !== awardKey).map((a, i, arr) => ( {a.emoji} {a.label} โ†’ ))}
); } Object.assign(window, { AwardPage });