docs & ux improvmeents

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-25 20:31:58 +00:00
parent 90e6e96b2b
commit 4bffede052
247 changed files with 6869 additions and 53517 deletions

View File

@@ -123,22 +123,26 @@ const LayoutContent: React.FC = () => {
return;
}
// Determine accent color based on credit level
// Determine accent color based on content pieces remaining
const remaining = balance.credits_remaining ?? balance.credits;
const total = balance.plan_credits_per_month ?? 0;
const usagePercent = total > 0 ? (remaining / total) * 100 : 100;
let accentColor: 'blue' | 'green' | 'amber' | 'purple' = 'blue';
if (balance.credits > 1000) {
if (usagePercent > 50) {
accentColor = 'green';
} else if (balance.credits > 100) {
} else if (usagePercent > 20) {
accentColor = 'blue';
} else if (balance.credits > 0) {
} else if (usagePercent > 0) {
accentColor = 'amber';
} else {
accentColor = 'purple';
}
// Set credit balance (single metric with label "Credits" - HeaderMetricsContext will merge it)
// Set content balance - show as "X/Y Content" for simplicity
setMetrics([{
label: 'Credits',
value: balance.credits,
label: 'Content',
value: total > 0 ? `${remaining}/${total}` : remaining,
accentColor,
}]);
}, [balance, isAuthenticated, setMetrics]);