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:
parent
85fa04bc75
commit
79e439ea05
@ -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>
|
||||||
|
{showConsumption ? (
|
||||||
<StyledCellWithIndicator>
|
<StyledCellWithIndicator>
|
||||||
<ConsumptionIndicator percentage={percentage || 0} />
|
<ConsumptionIndicator percentage={percentage || 0} />
|
||||||
<div>{formatIncludedDisplay()}</div>
|
<div>{formatIncludedDisplay()}</div>
|
||||||
</StyledCellWithIndicator>
|
</StyledCellWithIndicator>
|
||||||
|
) : (
|
||||||
|
<div />
|
||||||
|
)}
|
||||||
<div>{overage ? formatLargeNumbers(overage) : ''}</div>
|
<div>{overage ? formatLargeNumbers(overage) : ''}</div>
|
||||||
{hasAmount ? (
|
{hasAmount ? (
|
||||||
<StyledAmountCell>
|
<StyledAmountCell>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user