diff --git a/src/renderer/src/components/billing/PlanBillingUsage.tsx b/src/renderer/src/components/billing/PlanBillingUsage.tsx index cb82cb7451b..87c0f91b12a 100644 --- a/src/renderer/src/components/billing/PlanBillingUsage.tsx +++ b/src/renderer/src/components/billing/PlanBillingUsage.tsx @@ -76,7 +76,11 @@ export function UsageSummary({ = 100 ? 'warning' : 'default'} + tone={ + includedUsagePercent(entitlement) >= 100 && !entitlement.overage.optedIn + ? 'warning' + : 'default' + } aria-label={t('auto.components.billing.sandboxHoursUsedLabel', 'Sandbox hours used')} /> {entitlement.overageSeconds === 0 && @@ -167,6 +171,14 @@ export function OverageControls({ value2: formatCents(entitlement.offers?.team.defaultSpendCapCents ?? 2500, locale) } ) + const descriptionOn = t( + 'auto.components.billing.overageDescriptionOn', + 'Optional overage at {{value0}}/hour ({{value1}}/hour on Large), up to a monthly spend cap you set.', + { + value0: formatCents(overage.centsPerHour, locale), + value1: formatCents(Math.round(overage.centsPerHour * largeWeight), locale) + } + ) const capPercent = overage.spendCapCents > 0 ? Math.min(100, Math.round((overage.spentCents / overage.spendCapCents) * 100)) @@ -175,6 +187,7 @@ export function OverageControls({
= 100 ? 'warning' : 'default'} aria-label={t('auto.components.billing.capUsedLabel', 'Overage spend cap used')} />

@@ -222,7 +235,7 @@ export function OverageControls({ {t('auto.components.billing.overageTitle', 'Overage')}

- {description} + {optedIn ? descriptionOn : description}

- {capValid && entitlement.reason === 'overage_cap_reached' ? ( -

- {t( - 'auto.components.billing.capReachedHint', - 'Raise the cap to keep starting sandboxes. Your files are safe.' - )} -

- ) : null} {capValid ? null : (

{t('auto.components.billing.capInvalid', 'Enter a whole dollar amount.')} @@ -318,6 +323,14 @@ export function OverageControls({ {t('auto.components.billing.saveCap', 'Save')} ) : null} + {capValid && entitlement.reason === 'overage_cap_reached' ? ( +

+ {t( + 'auto.components.billing.capReachedHint', + 'Raise the cap to keep starting sandboxes. Your files are safe.' + )} +

+ ) : null} )} diff --git a/src/renderer/src/components/billing/plans/TeamPlanCard.tsx b/src/renderer/src/components/billing/plans/TeamPlanCard.tsx index a7c374aefb5..2bbb0a43b13 100644 --- a/src/renderer/src/components/billing/plans/TeamPlanCard.tsx +++ b/src/renderer/src/components/billing/plans/TeamPlanCard.tsx @@ -151,7 +151,7 @@ export function TeamPlanCard({ type="button" className="w-full" aria-disabled={busy || undefined} - onClick={onCheckout} + onClick={busy ? undefined : onCheckout} data-plans-primary="" > {busy ? : null} @@ -188,7 +188,7 @@ export function TeamPlanCard({ variant="outline" className="w-full" aria-disabled={busy || undefined} - onClick={onManage} + onClick={busy ? undefined : onManage} data-plans-primary="" > {t('auto.components.billing.manageBilling', 'Manage billing')} diff --git a/src/renderer/src/components/billing/team/TeamCreateView.tsx b/src/renderer/src/components/billing/team/TeamCreateView.tsx index 5ade64c6d99..da54718870e 100644 --- a/src/renderer/src/components/billing/team/TeamCreateView.tsx +++ b/src/renderer/src/components/billing/team/TeamCreateView.tsx @@ -53,7 +53,7 @@ export function TeamCreateView(props: TeamCreateViewProps): React.JSX.Element { className="mt-4 space-y-2" onSubmit={(event) => { event.preventDefault() - if (trimmed && !props.creating) { + if (trimmed && !props.creating && !props.unavailable) { props.onCreate(trimmed) } }} @@ -79,7 +79,8 @@ export function TeamCreateView(props: TeamCreateViewProps): React.JSX.Element { />