1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-10 01:19:53 +01:00

fix: hide usage when there is no limit (#10918)

This commit is contained in:
Jaanus Sellin 2025-11-05 11:37:56 +02:00 committed by GitHub
parent 85fa04bc75
commit 79e439ea05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,6 +70,7 @@ export const BillingInvoiceUsageRow = ({
: totalAmount;
const hasAmount = calculatedAmount && calculatedAmount > 0;
const showConsumption = hasValidData;
const formatIncludedDisplay = () => {
if (includedAmount !== undefined && limit !== undefined) {
@ -87,10 +88,14 @@ export const BillingInvoiceUsageRow = ({
return (
<>
<StyledDescriptionCell>{description}</StyledDescriptionCell>
<StyledCellWithIndicator>
<ConsumptionIndicator percentage={percentage || 0} />
<div>{formatIncludedDisplay()}</div>
</StyledCellWithIndicator>
{showConsumption ? (
<StyledCellWithIndicator>
<ConsumptionIndicator percentage={percentage || 0} />
<div>{formatIncludedDisplay()}</div>
</StyledCellWithIndicator>
) : (
<div />
)}
<div>{overage ? formatLargeNumbers(overage) : ''}</div>
{hasAmount ? (
<StyledAmountCell>