// Leaderboard, Admin, Datamodel screens function LeaderboardScreen() { const [expanded, setExpanded] = React.useState(null); const SEED = window.SEED; const { totals } = computeScores(); const finishedRaces = SEED.calendar.filter(r => getState().raceState[r.id] === "finished"); const ranked = SEED.players.map(p => ({ p, score: totals[p.id].total, })).sort((a, b) => b.score - a.score); ranked.forEach((row, i) => { row.rank = i === 0 || row.score < ranked[i - 1].score ? i + 1 : ranked[i - 1].rank; }); const podiumColors = { 1: "#FFD700", 2: "#C0C0C0", 3: "#CD7F32" }; return (