Skip to content

Commit f870931

Browse files
authored
bug(app): fix presentation error on missing price + currency (#8116)
When price and currency are missing, the tooltip displays ? ? / MWh. Instead, we should display ? / MWh in this scenario.
1 parent d1844a8 commit f870931

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web/src/features/charts/tooltips/PriceChartTooltip.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ export default function PriceChartTooltip({ zoneDetail }: InnerAreaGraphTooltipP
1919
priceObject?.value,
2020
priceObject?.currency
2121
);
22-
const currencySymbol = getSymbolFromCurrency(currency) ?? '?';
2322
const price = Number.isFinite(value) ? value : '?';
23+
const currencySymbol = getSymbolFromCurrency(currency) ?? '?';
24+
const currencySymbolToDisplay = price === '?' ? '' : currencySymbol;
2425

2526
return (
2627
<div className="w-full rounded-md bg-white p-3 shadow-xl dark:border dark:border-neutral-700 dark:bg-neutral-800 sm:w-64">
@@ -32,7 +33,7 @@ export default function PriceChartTooltip({ zoneDetail }: InnerAreaGraphTooltipP
3233
/>
3334
<p className="flex justify-center text-base">
3435
<b className="mr-1">{price}</b>
35-
{currencySymbol} / {unit}
36+
{currencySymbolToDisplay} / {unit}
3637
</p>
3738
</div>
3839
);

0 commit comments

Comments
 (0)