diff --git a/apps/webapp/app/components/billing/v3/UsageBar.tsx b/apps/webapp/app/components/billing/v3/UsageBar.tsx index c12d6d030be..7d4e5db2380 100644 --- a/apps/webapp/app/components/billing/v3/UsageBar.tsx +++ b/apps/webapp/app/components/billing/v3/UsageBar.tsx @@ -8,32 +8,16 @@ type UsageBarProps = { current: number; billingLimit?: number; tierLimit?: number; - projectedUsage?: number; isPaying: boolean; }; const startFactor = 4; -export function UsageBar({ - current, - billingLimit, - tierLimit, - projectedUsage, - isPaying, -}: UsageBarProps) { - const getLargestNumber = Math.max( - current, - tierLimit ?? -Infinity, - projectedUsage ?? -Infinity, - billingLimit ?? -Infinity, - 5 - ); +export function UsageBar({ current, billingLimit, tierLimit, isPaying }: UsageBarProps) { + const getLargestNumber = Math.max(current, tierLimit ?? -Infinity, billingLimit ?? -Infinity, 5); //creates a maximum range for the progress bar, add 10% to the largest number so the bar doesn't reach the end const maxRange = Math.round(getLargestNumber * 1.1); const tierRunLimitPercentage = tierLimit ? Math.round((tierLimit / maxRange) * 100) : 0; - const projectedRunsPercentage = projectedUsage - ? Math.round((projectedUsage / maxRange) * 100) - : 0; const billingLimitPercentage = billingLimit !== undefined ? Math.round((billingLimit / maxRange) * 100) : 0; const usagePercentage = Math.round((current / maxRange) * 100); @@ -42,7 +26,7 @@ export function UsageBar({ const usageCappedToLimitPercentage = Math.min(usagePercentage, tierRunLimitPercentage); return ( -
- {formatCurrency(usage.overall.current, false)} -
-- {formatCurrency(usage.overall.projected, false)} -
-+ {formatCurrency(usage.overall.current, false)} +