show extraction tooltip only if we have extractors

This commit is contained in:
calli
2025-04-23 15:23:32 +03:00
parent 0f33a7ff0c
commit f0d4708b43
2 changed files with 19 additions and 18 deletions

View File

@@ -102,9 +102,11 @@ export const PlanetCard = ({
return (
<Tooltip
title={
extractors.length > 0 ? (
<ExtractionSimulationTooltip
extractors={extractors}
/>
) : null
}
componentsProps={{
tooltip: {

View File

@@ -165,11 +165,8 @@ export const PlanetTableRow = ({
}
}}
onClick={(e) => {
// Only trigger if clicking a cell with the clickable-cell class
if (!(e.target as HTMLElement).closest('.clickable-cell')) return;
if (extractors.length > 0) {
setSimulationOpen(!simulationOpen);
}
}}
>
<TableCell component="th" scope="row" className="clickable-cell">
@@ -190,6 +187,7 @@ export const PlanetTableRow = ({
<Tooltip
placement="right"
title={
extractors.length > 0 ? (
<ExtractionSimulationTooltip
extractors={extractors
.filter(e => e.extractor_details?.product_type_id && e.extractor_details?.qty_per_cycle)
@@ -201,6 +199,7 @@ export const PlanetTableRow = ({
expiryTime: e.expiry_time ?? ""
}))}
/>
) : null
}
componentsProps={{
tooltip: {