import { 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 UserAvatar from "components/common/UserAvatar"; 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 TwinTable: React.FC = ({ player }) => { const { i18n } = useLingui(); const { gray } = useMyTheme(); return ( Date Power Weapon Mate Mate's weapon {player.leaguePlacements.TWIN.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 )!.player } /> member.player.switchAccountId !== player.switchAccountId )!.weapon } size={32} /> ); })}
); }; function LeagueMate({ mate, }: { mate: Player & { user: { username: string; discriminator: string; discordId: string; discordAvatar: string | null; } | null; }; }) { if (!mate.user && !mate.name) { return {"???"}; } if (mate.user) return ( {mate.user.username} ); return {mate.name}; } export default TwinTable;