-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: show why the team is invited or striked out
- Loading branch information
Showing
5 changed files
with
118 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
"use client"; | ||
|
||
import { shortenInstitutionName } from "@/utils/institution"; | ||
import { | ||
ChampionshipTeamLike, | ||
TeamRankInCombinedScoreboardStatus, | ||
} from "../data/types"; | ||
import { institutionRegionMap } from "../data/institution"; | ||
|
||
interface Props { | ||
team: ChampionshipTeamLike; | ||
} | ||
|
||
const MergedScoreboardTooltip = ({ team }: Props) => { | ||
const { status } = team; | ||
if (status === TeamRankInCombinedScoreboardStatus.NONE) return null; | ||
if (status === TeamRankInCombinedScoreboardStatus.D2) { | ||
return ( | ||
<> | ||
In top 2 teams of the South Pacific Independent Regional Contest (see | ||
D2) | ||
</> | ||
); | ||
} | ||
if (status === TeamRankInCombinedScoreboardStatus.D3_3) { | ||
return <>Won the regional st {team.fromSite} site (see D3 (3))</>; | ||
} | ||
if (status === TeamRankInCombinedScoreboardStatus.D4_2_1) { | ||
return <>Second instance of a single team (see D4 (2))</>; | ||
} | ||
if (status === TeamRankInCombinedScoreboardStatus.D4_2_2) { | ||
return ( | ||
<> | ||
4th or later instance of {shortenInstitutionName(team.institution)} (see | ||
D4 (2)) | ||
</> | ||
); | ||
} | ||
if (status === TeamRankInCombinedScoreboardStatus.D4_3) { | ||
return ( | ||
<> | ||
Lowest value from region {institutionRegionMap.get(team.institution)}{" "} | ||
(see D4 (3)) | ||
</> | ||
); | ||
} | ||
if (status === TeamRankInCombinedScoreboardStatus.D5) { | ||
return <>Wildcard team (see D5)</>; | ||
} | ||
|
||
return null; | ||
}; | ||
|
||
export default MergedScoreboardTooltip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters