diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 3de55e2..8083fe6 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -5536,37 +5536,12 @@ function inferSwissRounds(sides) { }) } -function TeamTotals({ matches, navigate, highlight, onHover }) { - const teams = useMemo(() => { - const map = {} - for (const match of matches) { - const teamA = displayTeamName(match.team_a_name) - const teamB = displayTeamName(match.team_b_name) - const winner = displayTeamName(match.winner_name) - for (const name of [teamA, teamB]) { - if (!name) continue - if (!map[name]) map[name] = { wins: 0, losses: 0 } - if (winner) { - if (winner === name) map[name].wins++ - else map[name].losses++ - } - } - } - return Object.entries(map) - .map(([name, s]) => ({ name, wins: s.wins, losses: s.losses, total: s.wins + s.losses })) - .sort((a, b) => b.wins - a.wins || a.losses - b.losses || a.name.localeCompare(b.name)) - }, [matches]) - - if (!teams.length) return null - +function TeamTotalsRoundTable({ teams, highlight, onHover, navigate }) { const active = Boolean(highlight) - + if (!teams.length) return null return (
- TEAM TOTALS -
-Team
W
L
@@ -5577,7 +5552,7 @@ function TeamTotals({ matches, navigate, highlight, onHover }) { const wr = team.total > 0 ? Math.round(team.wins / team.total * 100) : 0 return (+ TEAM TOTALS +
+