forked from molecule-ai/molecule-core
Adds the UI surface for the credit system to /orgs: - CreditsPill next to each org row. Tone shifts from zinc → amber at 10% of plan to red at zero. - LowCreditsBanner appears under the pill for running orgs when the balance crosses thresholds: overage_used > 0 → "overage active", balance <= 0 → "out of credits, upgrade", trial tail → "trial almost out". - Pure helpers extracted to lib/credits.ts so formatCredits, pillTone, and bannerKind are unit-tested without jsdom. Backend List query now returns credits_balance / plan_monthly_credits / overage_used_credits / overage_cap_credits so no second round-trip is needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __tests__ | ||
| api | ||
| validation | ||
| api.ts | ||
| auth.ts | ||
| billing.ts | ||
| canvas-actions.ts | ||
| credits.ts | ||
| deploy-preflight.ts | ||
| design-tokens.ts | ||
| hydrate.ts | ||
| runtime-names.ts | ||
| services.ts | ||
| tenant.ts | ||
| utils.ts | ||
| ws-url.ts | ||