// ════════════════════════════════════════════════════════════════ // QuotaBanner — баннер 75% / 90% / 100% использования // показывается под Header если usage > 75% // ════════════════════════════════════════════════════════════════ function QuotaBanner({ currentUser, onRoute }) { const B = window.SDH_BILLING; const sub = B.getSub(currentUser.id); if (!sub || sub.isInternal) return null; const tier = B.getTier(sub.tierCode); if (!tier.tokens || tier.tokens === 0) return null; const usage = B.buildUsage(currentUser.id, sub.tierCode); if (usage.pct < 0.75) return null; const isCritical = usage.pct >= 1; const isHigh = usage.pct >= 0.9; const hue = isCritical ? 'rose' : isHigh ? 'rose' : 'amber'; const left = Math.max(0, usage.tokensIncluded - usage.tokensUsed); const pctRound = Math.round(usage.pct * 100); // Sticky right below header return (