diff --git a/frontend/src/containers/Profile/PvpBrackets.tsx b/frontend/src/containers/Profile/PvpBrackets.tsx index 06bfa602..db03e605 100644 --- a/frontend/src/containers/Profile/PvpBrackets.tsx +++ b/frontend/src/containers/Profile/PvpBrackets.tsx @@ -1,58 +1,55 @@ -import { useMemo } from 'react'; +import {useMemo} from 'react'; import dayjs from 'dayjs-ext'; -import { Chip, LinearProgress, Tooltip } from '@mui/material'; +import {Chip, LinearProgress, Tooltip} from '@mui/material'; import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined'; -import { getSpecIcon, getWonAndLossColors, bracketToColor, getSeasonRankImageFromRating } from '@/utils/table'; -import { CLASS_AND_SPECS } from '@/constants/filterSchema'; -import type { IPlayerBracket, IPlayer } from '@/types'; +import {getSpecIcon, getWonAndLossColors, bracketToColor, getSeasonRankImageFromRating} from '@/utils/table'; +import {CLASS_AND_SPECS} from '@/constants/filterSchema'; +import type {IPlayerBracket, IPlayer} from '@/types'; interface IProps { player: IPlayer; } const arenaAndRbg = [ - { name: 'ARENA_2v2', title: '2v2' }, - { name: 'ARENA_3v3', title: '3v3' }, - { name: 'BATTLEGROUNDS', title: 'RBG' }, + {name: 'ARENA_2v2', title: '2v2'}, + {name: 'ARENA_3v3', title: '3v3'}, + {name: 'BATTLEGROUNDS', title: 'RBG'}, ]; const PvpBracket = ({ - title, - bracket, - isShuffle, - playerClass, - hasFourSpecs, -}: { + title, + bracket, + isZolo, + zoloName, + playerClass, + hasFourSpecs, + }: { title?: string; bracket?: IPlayerBracket; - isShuffle?: boolean; + isZolo?: boolean; + zoloName?: string playerClass?: string; hasFourSpecs: boolean; }) => { const specIcon = useMemo(() => { - if (!isShuffle || !title) return; - + if (!isZolo || !title) return; return getSpecIcon(`${title} ${playerClass}` || ''); - }, [title, isShuffle, playerClass]); - + }, [title, isZolo, playerClass]); const ratingColor = useMemo(() => { if (!bracket) return '#ffffff'; return bracketToColor(bracket); }, [bracket]); - const stats = useMemo(() => { const won = bracket?.won || 0; const lost = bracket?.lost || 0; const rating = bracket?.rating || 0; const is_rank_one_range = bracket?.is_rank_one_range || false; - - const { wonColor, lossColor } = getWonAndLossColors(won, lost); + const {wonColor, lossColor} = getWonAndLossColors(won, lost); const showWinRate = won > 0 || lost > 0; const winRate = ((won * 100) / (won + lost)).toFixed(2); const winRateColor = parseInt(winRate, 10) >= 50 ? "green" : "#ff0531"; - - return { rating, is_rank_one_range, showWinRate, winRateColor, wonColor, lossColor, winRate }; + return {rating, is_rank_one_range, showWinRate, winRateColor, wonColor, lossColor, winRate}; }, [bracket]); const ratingImg = ( -