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