import { Link } from "@remix-run/react"; import { WeaponImage } from "~/components/Image"; import { useTranslation } from "~/hooks/useTranslation"; import { vodVideoPage } from "~/utils/urls"; import type { ListVod } from "../vods-types"; import { PovUser } from "./VodPov"; export function VodListing({ vod, showUser = true, }: { vod: ListVod; showUser?: boolean; }) { const { t } = useTranslation(["vods"]); return (

{vod.title}

{vod.type === "CAST" || !showUser ? (
{t(`vods:type.${vod.type}`)}
) : ( )}
); } const MAX_WEAPONS_TO_SHOW = 4; function WeaponsPeek({ weapons }: { weapons: ListVod["weapons"] }) { const limitedWeapons = weapons.length <= MAX_WEAPONS_TO_SHOW ? weapons : weapons.slice(0, MAX_WEAPONS_TO_SHOW - 1); const amountOfWeaponsNotShown = weapons.length - limitedWeapons.length; return (
{limitedWeapons.map((weapon) => ( ))} {amountOfWeaponsNotShown > 0 ? (
+{amountOfWeaponsNotShown}
) : null}
); } function youtubeIdToThumbnailUrl(youtubeId: string) { return `http://img.youtube.com/vi/${youtubeId}/maxresdefault.jpg`; }