import { Box, Flex, Text } from "@chakra-ui/react"; import { Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import { Player } from "@prisma/client"; import MyLink from "components/common/MyLink"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "components/common/Table"; import WeaponImage from "components/common/WeaponImage"; import { getRankingString } from "lib/strings"; import { useMyTheme } from "lib/useMyTheme"; import { GetPlayerWithPlacementsData } from "prisma/queries/getPlayerWithPlacements"; interface Props { player: NonNullable; } const QuadTable: React.FC = ({ player }) => { const { i18n } = useLingui(); const { gray } = useMyTheme(); return ( Date Power Weapon Mates {player.leaguePlacements.QUAD.map(({ squad }, index) => { return ( {getRankingString(index + 1)} {new Date(squad.startTime).toLocaleString(i18n.locale, { month: "numeric", year: "numeric", hour: "numeric", day: "numeric", })} {squad.leaguePower} member.player.switchAccountId === player.switchAccountId )!.weapon } size={32} /> member.player.switchAccountId !== player.switchAccountId )} /> ); })}
); }; function LeagueMates({ mates, }: { mates: { player: Player & { user: { username: string; discriminator: string; discordId: string; discordAvatar: string | null; } | null; }; weapon: string; }[]; }) { return ( <> {mates.map((mate) => ( {mate.player.name ?? "???"} ))} ); } export default QuadTable;