fix: hide Fallgruppen with 0 entries from pie chart

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
CCS Admin 2026-02-26 20:42:03 +00:00
parent 8038c6e50d
commit a2b8d476b2

View file

@ -33,10 +33,12 @@ export function DashboardPage() {
const { data, isLoading: loading } = useDashboard(jahr)
const fallgruppenData = data
? Object.entries(data.kpis.fallgruppen).map(([key, value]) => ({
name: FALLGRUPPEN_LABELS[key] || key,
value,
}))
? Object.entries(data.kpis.fallgruppen)
.filter(([, value]) => value > 0)
.map(([key, value]) => ({
name: FALLGRUPPEN_LABELS[key] || key,
value,
}))
: []
const years = Array.from({ length: 5 }, (_, i) => currentYear - i)