From e085fcd59b4eb1913848fcdbcd4531d8658c1428 Mon Sep 17 00:00:00 2001 From: calli Date: Wed, 30 Apr 2025 17:30:36 +0300 Subject: [PATCH] add import tooltip to show import spesifics --- .../PlanetaryInteraction/PlanetTableRow.tsx | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/src/app/components/PlanetaryInteraction/PlanetTableRow.tsx b/src/app/components/PlanetaryInteraction/PlanetTableRow.tsx index 3873c19..bab7e31 100644 --- a/src/app/components/PlanetaryInteraction/PlanetTableRow.tsx +++ b/src/app/components/PlanetaryInteraction/PlanetTableRow.tsx @@ -358,30 +358,37 @@ export const PlanetTableRow = ({ const remainingAmount = Math.max(0, totalAmount - (consumptionPerHour * hoursSinceUpdate)); const hoursUntilDepletion = consumptionPerHour > 0 ? remainingAmount / consumptionPerHour : 0; + // Calculate monthly cost + const price = piPrices?.appraisal.items.find((a) => a.typeID === i.type_id)?.prices.sell.min ?? 0; + const monthlyCost = (consumptionPerHour * 24 * 30 * price) / 1000000; // Cost in millions + return (
- {renderProductDisplay(i.type_id, i.quantity * i.factoryCount)} - {totalAmount > 0 && ( - -
Total in storage: {totalAmount.toFixed(1)} units
-
Consumption rate: {consumptionPerHour.toFixed(1)} units/hour
-
Last update: {lastUpdate.toFormat('yyyy-MM-dd HH:mm:ss')}
-
Will be depleted in {hoursUntilDepletion.toFixed(1)} hours
- - }> - - ({hoursUntilDepletion.toFixed(1)}h) - -
- )} + +
Total in storage: {totalAmount.toFixed(1)} units
+
Consumption rate: {consumptionPerHour.toFixed(1)} units/hour
+
Last update: {lastUpdate.toFormat('yyyy-MM-dd HH:mm:ss')}
+
Will be depleted in {hoursUntilDepletion.toFixed(1)} hours
+
Monthly cost: {monthlyCost.toFixed(2)}M ISK
+ + }> +
+ {renderProductDisplay(i.type_id, i.quantity * i.factoryCount)} + {totalAmount > 0 && ( + + ({hoursUntilDepletion.toFixed(1)}h) + + )} +
+
); })}