mirror of
https://github.com/complexcaresolutions/dak.c2s.git
synced 2026-03-17 17:13:42 +00:00
fix: show admin dashboard cards even when no data exists for selected year
Previously the Abrechnungsstatus and Top 10 Gutachter cards were hidden when no data existed (e.g. gutachter field unpopulated in 2026). Now both cards render with a "no data" placeholder message instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
42fd1808c4
commit
7a372922e6
1 changed files with 35 additions and 29 deletions
|
|
@ -346,13 +346,13 @@ export function DashboardPage() {
|
||||||
{isAdmin && data && (
|
{isAdmin && data && (
|
||||||
<div className="grid grid-cols-1 gap-6 lg:grid-cols-3">
|
<div className="grid grid-cols-1 gap-6 lg:grid-cols-3">
|
||||||
{/* Abrechnungsstatus Donut */}
|
{/* Abrechnungsstatus Donut */}
|
||||||
{abrechnungsData.length > 0 && (
|
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle>Abrechnungsstatus</CardTitle>
|
<CardTitle>Abrechnungsstatus</CardTitle>
|
||||||
<p className="text-xs text-muted-foreground">Gutachten: abgerechnet vs. offen</p>
|
<p className="text-xs text-muted-foreground">Gutachten: abgerechnet vs. offen</p>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
|
{abrechnungsData.length > 0 ? (
|
||||||
<ResponsiveContainer width="100%" height={300}>
|
<ResponsiveContainer width="100%" height={300}>
|
||||||
<PieChart>
|
<PieChart>
|
||||||
<Pie
|
<Pie
|
||||||
|
|
@ -386,18 +386,21 @@ export function DashboardPage() {
|
||||||
/>
|
/>
|
||||||
</PieChart>
|
</PieChart>
|
||||||
</ResponsiveContainer>
|
</ResponsiveContainer>
|
||||||
|
) : (
|
||||||
|
<p className="text-sm text-muted-foreground py-8 text-center">Keine Gutachten für {jahr} vorhanden.</p>
|
||||||
|
)}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Gutachter-Verteilung */}
|
{/* Gutachter-Verteilung */}
|
||||||
{topGutachterData && topGutachterData.items.length > 0 && (
|
{topGutachterData && (
|
||||||
<Card className="lg:col-span-2">
|
<Card className="lg:col-span-2">
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle>Top 10 Gutachter</CardTitle>
|
<CardTitle>Top 10 Gutachter</CardTitle>
|
||||||
<p className="text-xs text-muted-foreground">Gutachten pro Gutachter in {jahr}</p>
|
<p className="text-xs text-muted-foreground">Gutachten pro Gutachter in {jahr}</p>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
|
{topGutachterData.items.length > 0 ? (
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
{topGutachterData.items.map((item, idx) => (
|
{topGutachterData.items.map((item, idx) => (
|
||||||
<div key={item.gutachter} className="space-y-1">
|
<div key={item.gutachter} className="space-y-1">
|
||||||
|
|
@ -417,6 +420,9 @@ export function DashboardPage() {
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
<p className="text-sm text-muted-foreground py-8 text-center">Keine Gutachter-Zuordnungen für {jahr} vorhanden.</p>
|
||||||
|
)}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue