Show imports per planet

This commit is contained in:
calli
2025-04-23 15:15:26 +03:00
parent 2a1e74ca79
commit bbdcece163
2 changed files with 8 additions and 2 deletions

View File

@@ -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)
</Typography>
))}
</div>

View File

@@ -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))