diff --git a/app/features/tournament-match/components/TournamentMatchBanner.tsx b/app/features/tournament-match/components/TournamentMatchBanner.tsx index b1f231e2b..da8227dff 100644 --- a/app/features/tournament-match/components/TournamentMatchBanner.tsx +++ b/app/features/tournament-match/components/TournamentMatchBanner.tsx @@ -267,25 +267,37 @@ function CurrentMapPickInfo({ }); if (!picker) return null; - const team = tournament.teamById(picker.teamId); - if (!team) return null; + const teamIds = picker.kind === "BOTH" ? picker.teamIds : [picker.teamId]; + const teams = teamIds + .map((teamId) => tournament.teamById(teamId)) + .filter((team) => team !== undefined); + if (teams.length !== teamIds.length) return null; - const text = t( - picker.kind === "COUNTERPICK" - ? "tournament:pickInfo.counterpickedBy" - : "tournament:pickInfo.pickedBy", - { teamName: team.name }, - ); + const text = (() => { + switch (picker.kind) { + case "BOTH": + return t("tournament:pickInfo.both"); + case "COUNTERPICK": + return t("tournament:pickInfo.counterpickedBy", { + teamName: teams[0].name, + }); + default: + return t("tournament:pickInfo.pickedBy", { teamName: teams[0].name }); + } + })(); return ( - + {teams.map((team) => ( + + ))} } > @@ -304,7 +316,10 @@ function resolveCurrentMapPicker({ results: Array<{ winnerTeamId: number }>; opponentIds: [number, number] | null; pickBan: TournamentRoundMaps["pickBan"] | null; -}): { teamId: number; kind: "PICK" | "COUNTERPICK" } | null { +}): + | { teamId: number; kind: "PICK" | "COUNTERPICK" } + | { teamIds: [number, number]; kind: "BOTH" } + | null { if (!opponentIds) return null; if (typeof source === "number") { @@ -312,6 +327,10 @@ function resolveCurrentMapPicker({ return { teamId: source, kind: "PICK" }; } + if (source === "BOTH") { + return { teamIds: opponentIds, kind: "BOTH" }; + } + if ( source === "COUNTERPICK" && (pickBan === "COUNTERPICK" || pickBan === "COUNTERPICK_MODE_REPEAT_OK")