UI: Fehler-States statt weißer Leerseiten bei Query-Fehlern

Dashboard/Projekt/Lead/Team/Historie rendern bei fehlgeschlagener Query nicht
mehr ein stilles `return null` (leere weisse Seite), sondern einen Hinweis mit
"Neu laden"-Button.

- Neue Komponente ErrorState (Meldung + optionaler Retry)
- 5 Routen: if (q.isError || !q.data) -> ErrorState mit q.refetch()

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Raffael SheikhandClaude Opus 4.8 committed 2026-06-07 11:35:52 +02:00
1 parent 90caa282ee
commit 8b0df9cc4e
6 files changed
+64 -5

No files matched your search

+8 -1
View File
@@ -4,6 +4,7 @@ import { voice } from '../lib/voice';
import { Card } from '../components/ui/Card';
import { Button } from '../components/ui/Button';
import { SkeletonCard } from '../components/ui/SkeletonCard';
import { ErrorState } from '../components/ui/ErrorState';
import { TeamTimeSection } from '../components/time/TeamTimeSection';
import { MODUS_META, type ProjectModus } from '../lib/project-meta';
import { AlertTriangle } from 'lucide-react';
@@ -23,7 +24,13 @@ export function DashboardRoute() {
</div>
);
}
if (!q.data) return null;
if (q.isError || !q.data)
return (
<ErrorState
message="Dashboard konnte nicht geladen werden."
onRetry={() => void q.refetch()}
/>
);
const isCheckedIn =
today.data?.entry?.status !== undefined && today.data.entry.status !== 'absent';