Skip to content

Commit

Permalink
releasef add predicitons
Browse files Browse the repository at this point in the history
  • Loading branch information
Sammers21 committed Apr 20, 2024
1 parent 847cade commit 1c22c5f
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions frontend/src/components/TableFilter/CutOffRating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const CutOffText = ({ bracket, statistic }: IProps) => {
const rankOneTitleColor = getRatingColor(true);
const rewards = statistic?.cutoffs?.rewards;
const spotWithNoAlts = statistic?.cutoffs?.spotWithNoAlts;
const predictions = statistic?.cutoffs?.predictions;

useEffect(() => {
setSelectedSpecs(getFromSearchParams(searchParams, "specs"));
Expand All @@ -33,27 +34,43 @@ const CutOffText = ({ bracket, statistic }: IProps) => {
if (bracket === "rbg" || bracket === "3v3") {
const cutOffRating = rewards?.[ratingRewardMap[bracket]];
const spotsWithNoAlts = spotWithNoAlts?.[ratingRewardMap[bracket]];
const predictedCutoff = predictions?.[`${ratingRewardMap[bracket]}`];
const title = bracket === "3v3" ? "Verdant Gladiator" : "Hero: Verdant";
var text;
if (predictedCutoff === cutOffRating) {
text = `${title} - Rating: ${cutOffRating}. Spots: ${spotsWithNoAlts}`;
}
else {
text = `${title} - Rating: BlizzardAPI:${cutOffRating} / Predicted:${predictedCutoff}. Spots: ${spotsWithNoAlts}`;
}
return (
<span
className="text-xs sm:text-lg font-light"
style={{ color: rankOneTitleColor }}
>
{bracket === "3v3"
? `Verdant Gladiator - Rating: ${cutOffRating}. Spots: ${spotsWithNoAlts}`
: `Hero: Verdant - Rating: ${cutOffRating}. Spots: ${spotsWithNoAlts}`}
{text}
</span>
);
} else if (bracket === "shuffle" && selectedSpecs.length == 1) {
const specName = SEARCH_PARAM_TO_FULL_SPEC[selectedSpecs[0]];
const key = `SHUFFLE/${SEARCH_PARAM_TO_SPEC[selectedSpecs[0]]}`;
const cutOffRating = rewards?.[key];
const spotsWithNoAlts = spotWithNoAlts?.[key];
const predictedCutoff = predictions?.[key];
const title = "Verdant Legend";
var text;
if (predictedCutoff === cutOffRating) {
text = `${title} for ${specName} - Rating: ${cutOffRating}. Spots: ${spotsWithNoAlts}`;
}
else {
text = `${title} for ${specName} - Rating: BlizzardAPI:${cutOffRating} / Predicted:${predictedCutoff}. Spots: ${spotsWithNoAlts}`;
}
return (
<span
className="text-xs sm:text-lg font-light"
style={{ color: rankOneTitleColor }}
>
{`Verdant Legend for ${specName} - Rating: ${cutOffRating}. Spots: ${spotsWithNoAlts}`}
{text}
</span>
);
} else if (bracket === "shuffle" && selectedSpecs.length == 0) {
Expand Down

0 comments on commit 1c22c5f

Please sign in to comment.