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:
1 parent
90caa282ee
commit
8b0df9cc4e
6 files changed
+64
-5
No files matched your search
@@ -7,6 +7,7 @@ import { trpc } from '../lib/trpc';
|
||||
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 { useConfirm } from '../components/ui/ConfirmProvider';
|
||||
import { useCurrentUser } from '../hooks/useCurrentUser';
|
||||
import { voice } from '../lib/voice';
|
||||
@@ -71,7 +72,13 @@ export function ProjektRoute() {
|
||||
const q = trpc.project.byId.useQuery({ id });
|
||||
const [abschlussOpen, setAbschlussOpen] = useState(false);
|
||||
if (q.isPending) return <SkeletonCard lines={6} />;
|
||||
if (!q.data) return null;
|
||||
if (q.isError || !q.data)
|
||||
return (
|
||||
<ErrorState
|
||||
message="Projekt konnte nicht geladen werden."
|
||||
onRetry={() => void q.refetch()}
|
||||
/>
|
||||
);
|
||||
const { project: p, area: a, milestones } = q.data;
|
||||
const isP1 = me?.id === p.verantwortlicheUserId;
|
||||
const pflichtKeys: Array<{ key: string; label: string }> = [
|
||||
|
||||
Reference in new issue
Block a user