diff --git a/src/app/tools/player-stats/[id]/components/FlippedTrigger.tsx b/src/app/tools/player-stats/[id]/components/FlippedTrigger.tsx deleted file mode 100644 index d6553c04b..000000000 --- a/src/app/tools/player-stats/[id]/components/FlippedTrigger.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { Tabs, Text } from '@radix-ui/themes'; -import { TriggerProps } from '@radix-ui/themes/dist/cjs/components/tabs'; - -export function FlippedTrigger({ children, ...props }: TriggerProps) { - return ( - - - {children} - - - ); -} diff --git a/src/app/tools/player-stats/[id]/page.tsx b/src/app/tools/player-stats/[id]/page.tsx deleted file mode 100644 index 544435af3..000000000 --- a/src/app/tools/player-stats/[id]/page.tsx +++ /dev/null @@ -1,322 +0,0 @@ -'use client'; - -import { TimerIcon } from '@radix-ui/react-icons'; -import { - Box, - Button, - Flex, - Heading, - Link, - Popover, - SegmentedControl, - Text, - Theme, -} from '@radix-ui/themes'; -import { useState } from 'react'; -import { DatePicker } from '../../../../components/DatePicker'; -import { Speedometer } from '../../../../components/Speedometer'; -import { getAccountInfo } from '../../../../core/blitz/getAccountInfo'; -import { getClanAccountInfo } from '../../../../core/blitz/getClanAccountInfo'; -import { idToRegion } from '../../../../core/blitz/idToRegion'; -import { parseBkni } from '../../../../core/blitzkit/parseBkni'; -import { PeriodType } from '../../../../core/discord/addPeriodSubCommands'; -import { - BKNI_COLORS, - BKNI_PERCENTILES, -} from '../../../../core/statistics/getBkniPercentile'; -import { useAwait } from '../../../../hooks/useAwait'; -import strings from '../../../../lang/en-US.json'; - -export default function Page({ params }: { params: { id: string } }) { - const id = parseInt(params.id); - const region = idToRegion(id); - const accountInfo = useAwait(getAccountInfo(region, id)); - const clanAccountInfo = useAwait(getClanAccountInfo(region, id, ['clan'])); - // const bkni = ((Math.round(Date.now() / 1000 / 60) / 100) % 2) - 1; - const bkni = 0.81; - const winrate = 0.6; - const [period, setPeriod] = useState('30'); - const { bkniColor, bkniMetric, bkniFraction, bkniPercentile } = - parseBkni(bkni); - const [customFrom, setCustomFrom] = useState( - new Date(Date.now() - 29 * 24 * 60 * 60 * 1000), - ); - const stats = [ - ['Damage', '3,203'], - ['Tier', '9.83'], - ['Survival', '70%'], - ['Kills', '1.54'], - ['Damage ratio', '2.45'], - ['Accuracy', '91%'], - ]; - const [customTo, setCustomTo] = useState(new Date()); - const [fromSelectorOpen, setFromSelectorOpen] = useState(false); - const [toSelectorOpen, setToSelectorOpen] = useState(false); - - return ( - <> - - - - - {accountInfo.nickname} - - - {clanAccountInfo?.clan && `[${clanAccountInfo.clan.tag}] • `} - { - (clanAccountInfo?.clan - ? strings.common.regions.short - : strings.common.regions.normal)[region] - } - - - - - setPeriod(value as PeriodType)} - > - - Today - - - 30 days - - - Career - - - Custom - - - - {period === 'custom' && ( - - From{' '} - - - - {customFrom.toLocaleString(undefined, { - month: 'short', - day: 'numeric', - year: 'numeric', - })} - - - - - { - setCustomFrom(date); - setFromSelectorOpen(false); - }} - /> - - {' '} - to{' '} - - - - {customTo.toLocaleString(undefined, { - month: 'short', - day: 'numeric', - year: 'numeric', - })} - - - - - { - setCustomTo(date); - setToSelectorOpen(false); - }} - /> - - - - )} - - - - - - - - - - - - - - BkNI - - - A next generation performance metric - - - - {BKNI_PERCENTILES.map(({ percentile, min }, index) => ( - - ))} - - - - } - /> - - - {(winrate * 100).toFixed(0)} - - % - - - } - color="green" - fill={0.5 * (Math.cbrt(2 * winrate - 1) + 1)} - label={Winrate} - /> - - - - {stats.map((stat) => ( - - {stat[1]} - - {stat[0]} - - - ))} - - - - - - {/* - - - - */} - {/* - - - */} - - {/* - { - setPeriod(value === 'custom' ? 'custom' : Number(value)); - }} - > - - Today - 30 days - Career - Custom - - - - - - - - - - - - - - - We haven't tracked long enough to provide statistics. Please check - back after a few days. - - - - - {isTracking && } */} - - ); -} diff --git a/src/app/tools/player-stats/page.tsx b/src/app/tools/player-stats/page.tsx deleted file mode 100644 index 2ad419791..000000000 --- a/src/app/tools/player-stats/page.tsx +++ /dev/null @@ -1,110 +0,0 @@ -'use client'; - -import { ArrowDownIcon, MagnifyingGlassIcon } from '@radix-ui/react-icons'; -import { Button, Card, Flex, Text, TextField } from '@radix-ui/themes'; -import { useRef, useState } from 'react'; -import { Link } from '../../../components/Link'; -import PageWrapper from '../../../components/PageWrapper'; -import { UNLOCALIZED_REGION_NAMES_SHORT } from '../../../constants/regions'; -import searchPlayersAcrossRegions, { - AccountListWithServer, -} from '../../../core/blitz/searchPlayersAcrossRegions'; - -export default function Page() { - const input = useRef(null); - const [showSearch, setShowSearch] = useState(false); - const [searching, setSearching] = useState(false); - const [searchResults, setSearchResults] = useState([]); - - async function search() { - if (!input.current) return; - - setSearchResults(await searchPlayersAcrossRegions(input.current.value, 9)); - setSearching(false); - } - - return ( - - - - Look up a player to get started - - - - { - if (!input.current) return; - - const sanitized = input.current.value.trim(); - - if (sanitized.length > 0) { - setShowSearch(true); - setSearching(true); - search(); - } else { - setShowSearch(false); - } - }} - > - - - - - {showSearch && ( - - {searching && ( - - Searching... - - )} - - {!searching && searchResults.length === 0 && ( - - No players found - - )} - - {!searching && searchResults.length > 0 && ( - - {searchResults.map((player) => ( - - - - ))} - - )} - - )} - - - - ); -}