diff --git a/src/components/quota/quotaConfigs.ts b/src/components/quota/quotaConfigs.ts index 0d797f9e..5e28d543 100644 --- a/src/components/quota/quotaConfigs.ts +++ b/src/components/quota/quotaConfigs.ts @@ -1749,6 +1749,21 @@ const formatXaiRemainingAmount = (billing: XaiBillingSummary): string => { return `${remaining} / ${limit}`; }; +const XAI_SUPERGROK_LIMIT_CENTS = 15_000; +const XAI_SUPERGROK_HEAVY_LIMIT_CENTS = 150_000; + +const resolveXaiPlan = ( + monthlyLimitCents: number | null +): { labelKey: string; premium: boolean } | null => { + if (monthlyLimitCents === XAI_SUPERGROK_LIMIT_CENTS) { + return { labelKey: 'plan_supergrok', premium: false }; + } + if (monthlyLimitCents === XAI_SUPERGROK_HEAVY_LIMIT_CENTS) { + return { labelKey: 'plan_supergrok_heavy', premium: true }; + } + return null; +}; + const renderXaiItems = ( quota: XaiQuotaState, t: TFunction, @@ -1769,6 +1784,7 @@ const renderXaiItems = ( const amountLabel = formatXaiRemainingAmount(billing); const resetLabel = formatQuotaResetTime(billing.billingPeriodEnd); const onDemandCap = billing.onDemandCapCents ?? 0; + const plan = resolveXaiPlan(billing.monthlyLimitCents); const payAsYouGoLabel = onDemandCap > 0 ? t('xai_quota.pay_as_you_go_enabled', { cap: formatUsdFromCents(onDemandCap) }) @@ -1777,6 +1793,18 @@ const renderXaiItems = ( return h( Fragment, null, + plan + ? h( + 'div', + { key: 'plan', className: styleMap.codexPlan }, + h('span', { className: styleMap.codexPlanLabel }, t('xai_quota.plan_label')), + h( + 'span', + { className: plan.premium ? styleMap.premiumPlanValue : styleMap.codexPlanValue }, + t(`xai_quota.${plan.labelKey}`) + ) + ) + : null, h( 'div', { key: 'pay-as-you-go', className: styleMap.codexPlan }, diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index af1de698..b94dad44 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -528,6 +528,9 @@ "refresh_button": "Refresh Quota", "fetch_all": "Fetch All", "monthly_credits": "Monthly credits", + "plan_label": "Plan", + "plan_supergrok": "SuperGrok", + "plan_supergrok_heavy": "SuperGrok Heavy", "pay_as_you_go_label": "Pay as you go", "pay_as_you_go_enabled": "Enabled, cap {{cap}}", "pay_as_you_go_disabled": "Disabled" diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index 23e9a0d1..229ccca4 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -515,6 +515,9 @@ "refresh_button": "Обновить квоту", "fetch_all": "Получить все", "monthly_credits": "Месячные кредиты", + "plan_label": "План", + "plan_supergrok": "SuperGrok", + "plan_supergrok_heavy": "SuperGrok Heavy", "pay_as_you_go_label": "Оплата по факту", "pay_as_you_go_enabled": "Включено, лимит {{cap}}", "pay_as_you_go_disabled": "Отключено" diff --git a/src/i18n/locales/zh-CN.json b/src/i18n/locales/zh-CN.json index d089b79c..7f66545a 100644 --- a/src/i18n/locales/zh-CN.json +++ b/src/i18n/locales/zh-CN.json @@ -528,6 +528,9 @@ "refresh_button": "刷新额度", "fetch_all": "获取全部", "monthly_credits": "月度积分", + "plan_label": "套餐", + "plan_supergrok": "SuperGrok", + "plan_supergrok_heavy": "SuperGrok Heavy", "pay_as_you_go_label": "按量付费", "pay_as_you_go_enabled": "已启用,封顶 {{cap}}", "pay_as_you_go_disabled": "未启用" diff --git a/src/i18n/locales/zh-TW.json b/src/i18n/locales/zh-TW.json index 9d33f958..5da0f12c 100644 --- a/src/i18n/locales/zh-TW.json +++ b/src/i18n/locales/zh-TW.json @@ -528,6 +528,9 @@ "refresh_button": "重新整理配額", "fetch_all": "取得全部", "monthly_credits": "月度點數", + "plan_label": "方案", + "plan_supergrok": "SuperGrok", + "plan_supergrok_heavy": "SuperGrok Heavy", "pay_as_you_go_label": "按量付費", "pay_as_you_go_enabled": "已啟用,封頂 {{cap}}", "pay_as_you_go_disabled": "未啟用"