import { Link } from "@remix-run/react"; import { useTranslation } from "react-i18next"; import { Avatar } from "~/components/Avatar"; import { SendouButton } from "~/components/elements/Button"; import { SendouPopover } from "~/components/elements/Popover"; import { UsersIcon } from "~/components/icons/Users"; import { Placement } from "~/components/Placement"; import { Table } from "~/components/Table"; import { databaseTimestampToDate } from "~/utils/dates"; import { calendarEventPage, tournamentBracketsPage, tournamentTeamPage, userPage, } from "~/utils/urls"; import type { UserResultsLoaderData } from "../loaders/u.$identifier.results.server"; import { ParticipationPill } from "./ParticipationPill"; export type UserResultsTableProps = { results: UserResultsLoaderData["results"]["value"]; id: string; hasHighlightCheckboxes?: boolean; }; export const HIGHLIGHT_CHECKBOX_NAME = "highlightTeamIds"; export const HIGHLIGHT_TOURNAMENT_CHECKBOX_NAME = "highlightTournamentTeamIds"; export function UserResultsTable({ results, id, hasHighlightCheckboxes, }: UserResultsTableProps) { const { t, i18n } = useTranslation("user"); const placementHeaderId = `${id}-th-placement`; return (
| } | {t("results.placing")} | {t("results.date")} | {t("results.tournament")} | {t("results.participation")} | {t("results.team")} |
|---|---|---|---|---|---|
| )} |
/ {result.participantCount}
|
{databaseTimestampToDate(result.startTime).toLocaleDateString( i18n.language, { day: "numeric", month: "short", year: "numeric", }, )} |
{result.eventId ? (
{result.eventName}
) : null}
{result.tournamentId ? (
<>
{result.logoUrl ? (
|
|
|