- {quotaStatus === 'loading' ? (
-
{t('codex_quota.loading')}
- ) : quotaStatus === 'idle' ? (
-
{t('codex_quota.idle')}
- ) : quotaStatus === 'error' ? (
-
- {t('codex_quota.load_failed', {
- message: quotaErrorMessage
- })}
-
- ) : (
- <>
- {planLabel && (
-
- {t('codex_quota.plan_label')}
- {planLabel}
-
- )}
- {isFreePlan ? (
-
{t('codex_quota.no_access')}
- ) : windows.length === 0 ? (
-
{t('codex_quota.empty_windows')}
- ) : (
- windows.map((window) => {
- const used = window.usedPercent;
- const clampedUsed = used === null ? null : Math.max(0, Math.min(100, used));
- const remaining =
- clampedUsed === null ? null : Math.max(0, Math.min(100, 100 - clampedUsed));
- const percentLabel = remaining === null ? '--' : `${Math.round(remaining)}%`;
- const quotaBarClass =
- remaining === null
- ? styles.quotaBarFillMedium
- : remaining >= 80
- ? styles.quotaBarFillHigh
- : remaining >= 50
- ? styles.quotaBarFillMedium
- : styles.quotaBarFillLow;
-
- return (
-
-
-
{window.label}
-
- {percentLabel}
- {window.resetLabel}
-
-
-
-
- );
- })
- )}
- >
- )}
-