From bbdcece163810d42f8282c8a673254d294580f9d Mon Sep 17 00:00:00 2001 From: calli Date: Wed, 23 Apr 2025 15:15:26 +0300 Subject: [PATCH] Show imports per planet --- .../components/PlanetaryInteraction/PlanetTableRow.tsx | 2 +- src/planets.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/components/PlanetaryInteraction/PlanetTableRow.tsx b/src/app/components/PlanetaryInteraction/PlanetTableRow.tsx index afbe8da..783ef6d 100644 --- a/src/app/components/PlanetaryInteraction/PlanetTableRow.tsx +++ b/src/app/components/PlanetaryInteraction/PlanetTableRow.tsx @@ -291,7 +291,7 @@ export const PlanetTableRow = ({ key={`import-${character.character.characterId}-${planet.planet_id}-${i.type_id}`} fontSize={theme.custom.smallText} > - {PI_TYPES_MAP[i.type_id].name} ({i.quantity}/h) + {PI_TYPES_MAP[i.type_id].name} ({i.quantity * i.factoryCount}/h) ))} diff --git a/src/planets.ts b/src/planets.ts index 5982905..bff50ef 100644 --- a/src/planets.ts +++ b/src/planets.ts @@ -94,7 +94,13 @@ export const planetCalculations = (planet: PlanetWithInfo) => { ![...locallyProduced, ...locallyExcavated].some( (lp) => lp === p.type_id, ), - ); + ).map((p) => ({ + ...p, + factoryCount: planetInfo.pins + .filter((f) => f.schematic_id === p.schematic_id) + .length, + })); + const localExports = locallyProduced .filter((p) => !locallyConsumed.some((lp) => lp === p))