hasUpgrades

This commit is contained in:
tresabhi committed 2026-09-22 16:24:29 -05:00
1 parent 99965118b3
commit 99317c2075
2 files changed
+12 -4

No files matched your search

@@ -1,4 +1,5 @@
import { useProtagonist } from "../../hooks/useProtagonist";
import { hasUpgrades } from "../../tankopedia/hasUpgrades";
import type { ComputedCharacteristics } from "../../types/characteristics";
interface TankopediaLoadoutProps {
@@ -7,10 +8,7 @@ interface TankopediaLoadoutProps {
export function TankopediaLoadout({ characteristics }: TankopediaLoadoutProps) {
const tank = useProtagonist();
const showModules = tank.tank!.upgrade_lines.some(
(line) => line.stages.length > 1 || isAlternativeLine(line.name),
);
const showModules = hasUpgrades(tank);
return (
<>
@@ -0,0 +1,10 @@
import type { TankDefinition } from "@blitzkit/core";
export function hasUpgrades(tank: TankDefinition) {
return (
tank.tracks.length > 1 ||
tank.engines.length > 1 ||
tank.turrets.length > 1 ||
tank.turrets.some((turret) => turret.guns.length > 1)
);
}