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 { useTimeFormat } from "~/hooks/useTimeFormat"; import { databaseTimestampToDate } from "~/utils/dates"; import { calendarEventPage, tournamentBracketsPage, tournamentTeamPage, userPage, } from "~/utils/urls"; import type { UserResultsLoaderData } from "../loaders/u.$identifier.results.server"; import styles from "../user-page.module.css"; 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 } = useTranslation("user"); const { formatDate } = useTimeFormat(); const placementHeaderId = `${id}-th-placement`; return (
| } | {t("results.placing")} | {t("results.date")} | {t("results.tournament")} | {t("results.participation")} | {t("results.team")} |
|---|---|---|---|---|---|
| )} |
/ {result.participantCount}
|
{formatDate(databaseTimestampToDate(result.startTime), { day: "numeric", month: "short", year: "numeric", })} |
{result.eventId ? (
{result.eventName}
) : null}
{result.tournamentId ? (
<>
{result.logoUrl ? (
|
|
|