Skip to content

Commit

Permalink
ASKJFD
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-flynn committed Sep 29, 2024
1 parent ddd970c commit 0ce8db1
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ import styled from '@emotion/styled';
import { FC, useMemo } from 'react';
import RED_BANNER from '../assets/red-top-banner.png';
import BLUE_BANNER from '../assets/blue-top-banner.png';
import { Alliance, BLUE_STATION, Match, Ranking, Team } from '@toa-lib/models';
import {
Alliance,
BLUE_STATION,
Match,
QUALIFICATION_LEVEL,
Ranking,
Team
} from '@toa-lib/models';
import { CountryFlag } from './country-flag';
import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward';
import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward';
Expand All @@ -13,6 +20,7 @@ import { Grid } from '@mui/material';
import BreakdownRow from './breakdown-row';
import { Block } from '@mui/icons-material';
import { CardStatus } from '@toa-lib/models/build/seasons/FeedingTheFuture';
import { useCurrentTournament } from 'src/api/use-tournament-data';

const Container = styled.div`
display: flex;
Expand Down Expand Up @@ -151,6 +159,7 @@ export const AllianceResult: FC<Props> = ({
ranks,
teams
}) => {
const tournament = useCurrentTournament();
const participants = match.participants ?? [];
const allianceParticipants = participants.filter((p) =>
alliance === 'red' ? p.station < BLUE_STATION : p.station >= BLUE_STATION
Expand All @@ -159,8 +168,9 @@ export const AllianceResult: FC<Props> = ({
() => (teams ? Object.fromEntries(teams.map((t) => [t.teamKey, t])) : {}),
[teams]
);
const isPlayoffs =
match.tournamentKey === 't3' || match.tournamentKey === 't4';
const isPlayoffs = tournament
? tournament.tournamentLevel > QUALIFICATION_LEVEL
: false;
const isAllianceRedCard =
allianceParticipants.filter((p) => p.cardStatus === CardStatus.RED_CARD)
.length >= 3;
Expand Down

0 comments on commit 0ce8db1

Please sign in to comment.