diff --git a/static/gsApp/views/subscriptionPage/usageOverview/components/cta.tsx b/static/gsApp/views/subscriptionPage/usageOverview/components/cta.tsx index 789ea9035cf0e7..2a6c8dc053f1a6 100644 --- a/static/gsApp/views/subscriptionPage/usageOverview/components/cta.tsx +++ b/static/gsApp/views/subscriptionPage/usageOverview/components/cta.tsx @@ -21,7 +21,12 @@ import { type ProductTrial, type Subscription, } from 'getsentry/types'; -import {checkIsAddOn, getBilledCategory, hasBillingAccess} from 'getsentry/utils/billing'; +import { + checkIsAddOn, + formatReservedWithUnits, + getBilledCategory, + hasBillingAccess, +} from 'getsentry/utils/billing'; import {getPlanCategoryName} from 'getsentry/utils/dataCategory'; import { USAGE_OVERVIEW_PANEL_HEADER_HEIGHT, @@ -224,20 +229,47 @@ function ProductTrialCta({ ); } + const metricHistory = subscription.categories[billedCategory]; + + // ignore products with 0 or unlimited reserved volume or that are reserved budget-based + const hasUsedUpReserved = + metricHistory?.usageExceeded && (metricHistory?.reserved ?? 0) > 0; + return ( } organization={organization} - source="usage-overview" + source={hasUsedUpReserved ? 'usage-overview-alt' : 'usage-overview'} requestData={{ productTrial: { category: potentialProductTrial.category, @@ -251,7 +283,9 @@ function ProductTrialCta({ busy={trialButtonBusy} disabled={trialButtonBusy} > - {t('Activate free trial')} + {hasUsedUpReserved + ? tct('Start your unlimited [productName] trial', {productName}) + : t('Activate free trial')}