feat(web): add match detail tabs
This commit is contained in:
1 parent
a88562b208
commit
96bae0ce28
5 files changed
+523
-29
No files matched your search
@@ -7,6 +7,7 @@ import type {
|
||||
import { Link } from "react-router";
|
||||
import { CompetitionSeriesHistory } from "./CompetitionSeriesHistory";
|
||||
import { DoubleEliminationBracket } from "./DoubleEliminationBracket";
|
||||
import { createCompetitionSeriesHistory } from "./competition-series-history";
|
||||
import { createCompetitionBracketLayout } from "./competition-display-layout";
|
||||
import { bracketRoundLabel } from "./double-elimination-bracket-layout";
|
||||
import { RoundRobinTable } from "./RoundRobinTable";
|
||||
@@ -14,13 +15,40 @@ import { SeriesScoreCard } from "./SeriesScoreCard";
|
||||
|
||||
export function CompetitionResults({
|
||||
competition,
|
||||
view = "all",
|
||||
}: {
|
||||
competition: CompetitionDetailResponse;
|
||||
view?: "all" | "bracket" | "games";
|
||||
}) {
|
||||
const { projection } = competition;
|
||||
const teamById = new Map(
|
||||
competition.teams.map((team) => [team.teamId, team]),
|
||||
);
|
||||
|
||||
if (view === "games") {
|
||||
const hasSeriesHistory =
|
||||
createCompetitionSeriesHistory(projection).length > 0;
|
||||
return (
|
||||
<div className="mb-6">
|
||||
{hasSeriesHistory ? (
|
||||
<CompetitionSeriesHistory
|
||||
communityId={competition.communityId}
|
||||
matchId={competition.matchId}
|
||||
projection={projection}
|
||||
teamById={teamById}
|
||||
/>
|
||||
) : (
|
||||
<p
|
||||
className="border border-dashed border-base-content/15 px-4 py-8 text-center text-sm text-base-content/45"
|
||||
role="status"
|
||||
>
|
||||
기록된 공식 경기가 없습니다.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const seriesById = new Map(
|
||||
projection.series.map((series) => [series.seriesId, series]),
|
||||
);
|
||||
@@ -82,12 +110,14 @@ export function CompetitionResults({
|
||||
</p>
|
||||
)}
|
||||
|
||||
<CompetitionSeriesHistory
|
||||
communityId={competition.communityId}
|
||||
matchId={competition.matchId}
|
||||
projection={projection}
|
||||
teamById={teamById}
|
||||
/>
|
||||
{view === "all" && (
|
||||
<CompetitionSeriesHistory
|
||||
communityId={competition.communityId}
|
||||
matchId={competition.matchId}
|
||||
projection={projection}
|
||||
teamById={teamById}
|
||||
/>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user