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 ( return (
<Tooltip <Tooltip
title={ title={
extractors.length > 0 ? (
<ExtractionSimulationTooltip <ExtractionSimulationTooltip
extractors={extractors} extractors={extractors}
/> />
) : null
} }
componentsProps={{ componentsProps={{
tooltip: { tooltip: {

View File

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