feat: add feature usage UI components (Phase 3)
Deploy Development / deploy (push) Successful in 35s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 12s

- Add api.getFeatureUsage() endpoint call
- Create UsageBadge component (inline indicators)
- Create FeatureUsageOverview component (Settings table)
- Add "Kontingente" section to Settings page
- Color-coded status (green/yellow/red)
- Grouped by category
- Shows reset period and next reset date

Phase 3: Frontend Display

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 4.6 committed 2026-03-21 06:39:52 +01:00
1 parent d10f605d66
commit 405abc1973
6 files changed
+393 -1

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
/**
* UsageBadge - Small inline usage indicator
*
* Shows usage quota in format: (used/limit)
* Color-coded: green (ok), yellow (warning), red (exceeded)
*
* Phase 3: Frontend Display
*/
import './UsageBadge.css'
export default function UsageBadge({ used, limit, remaining, allowed }) {
// Don't show badge if unlimited
if (limit === null || limit === undefined) {
return null
}
// Determine status for color coding
let status = 'ok'
if (!allowed || remaining < 0) {
status = 'exceeded'
} else if (limit > 0 && remaining <= Math.ceil(limit * 0.2)) {
// Warning at 20% or less remaining
status = 'warning'
}
return (
<span className={`usage-badge usage-badge--${status}`}>
({used}/{limit})
</span>
)
}