Files
sendou.ink/app/components/WeaponPoolBanner.tsx
Kalle f40fdb5f26
Some checks failed
E2E Tests / e2e (push) Has been cancelled
Tests and checks on push / run-checks-and-tests (push) Has been cancelled
Updates translation progress / update-translation-progress-issue (push) Has been cancelled
Weapon landing flow for builds/analyzer/obj dmg calc (#3437)
2026-10-03 16:23:18 +03:00

44 lines
1.3 KiB
TypeScript

import { Star } from "lucide-react";
import { useTranslation } from "react-i18next";
import { Link } from "react-router";
import { CircleBackdrop } from "~/components/CircleBackdrop";
import { WeaponImage } from "~/components/Image";
import type { MainWeaponId } from "~/modules/in-game-lists/types";
import styles from "./WeaponPoolBanner.module.css";
/** Highlighted row of quick links to the weapons of the user's match profile weapon pool. */
export function WeaponPoolBanner({
weaponIds,
weaponHref,
defaultShouldRevalidate,
}: {
weaponIds: MainWeaponId[];
weaponHref: (weaponId: MainWeaponId) => string;
defaultShouldRevalidate?: boolean;
}) {
const { t } = useTranslation(["common"]);
return (
<section className={styles.weaponPoolBanner}>
<h2 className={styles.header}>
<Star className={styles.icon} aria-hidden />
{t("common:yourWeapons")}
</h2>
<div className={styles.weapons}>
{weaponIds.map((weaponId) => (
<Link
key={weaponId}
to={weaponHref(weaponId)}
defaultShouldRevalidate={defaultShouldRevalidate}
className={styles.weapon}
>
<CircleBackdrop>
<WeaponImage weaponSplId={weaponId} variant="badge" size={28} />
</CircleBackdrop>
</Link>
))}
</div>
</section>
);
}