import { Link } from "@remix-run/react"; import { Image, WeaponImage } from "~/components/Image"; import { useTranslation } from "~/hooks/useTranslation"; import { brandImageUrl, modeImageUrl, topSearchPage, topSearchPlayerPage, } from "~/utils/urls"; import { monthYearToSpan } from "../top-search-utils"; import type { FindPlacement } from "../queries/findPlacements.server"; interface PlacementsTableProps { placements: Array; type?: "PLAYER_NAME" | "MODE_INFO"; } export function PlacementsTable({ placements, type = "PLAYER_NAME", }: PlacementsTableProps) { const { t } = useTranslation(["game-misc"]); return (
{placements.map((placement, i) => (
{placement.rank}
{type === "MODE_INFO" ? ( <>
{
{t(`game-misc:MODE_LONG_${placement.mode}`)}
) : null} {type === "PLAYER_NAME" ?
{placement.name}
: null} {type === "MODE_INFO" ? (
{monthYearToSpan(placement).from.month}/ {monthYearToSpan(placement).from.year} -{" "} {monthYearToSpan(placement).to.month}/ {monthYearToSpan(placement).to.year}
) : null}
{placement.power}
))}
); }