mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 07:13:29 +00:00
fix(ui): route bare read-failure branches through QueryErrorCard
Eight data surfaces still rendered a read failure as a bare text-destructive paragraph with no retry: the biomarker manager, the lab values list, the three record managers (allergies, family history, conditions), the illness episode detail, and the intake history table; the lab biomarker detail carried an inline near-duplicate of the primitive from before it existed. Replace all of them with QueryErrorCard wired to the query's refetch, keeping each surface's own error string. Inline role="alert" text remains the pattern for mutation errors inside forms.
This commit is contained in:
1 parent
21b65788ae
commit
9a35cfb3e9
8 files changed
+54
-41
No files matched your search
@@ -13,6 +13,7 @@ import { useState } from "react";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { QueryErrorCard } from "@/components/ui/query-error-card";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { useTranslations, useFormatters } from "@/lib/i18n/context";
|
||||
|
||||
@@ -35,7 +36,12 @@ function todayLocal(): string {
|
||||
export function IllnessEpisodeDetail({ episodeId }: { episodeId: string }) {
|
||||
const { t } = useTranslations();
|
||||
const fmt = useFormatters();
|
||||
const { data: episode, isLoading, isError } = useIllnessEpisode(episodeId);
|
||||
const {
|
||||
data: episode,
|
||||
isLoading,
|
||||
isError,
|
||||
refetch,
|
||||
} = useIllnessEpisode(episodeId);
|
||||
const resolve = useResolveEpisode();
|
||||
|
||||
const [logOpen, setLogOpen] = useState(false);
|
||||
@@ -44,9 +50,10 @@ export function IllnessEpisodeDetail({ episodeId }: { episodeId: string }) {
|
||||
|
||||
if (isError) {
|
||||
return (
|
||||
<p className="text-destructive py-8 text-center text-sm">
|
||||
{t("illness.loadError")}
|
||||
</p>
|
||||
<QueryErrorCard
|
||||
title={t("illness.loadError")}
|
||||
onRetry={() => void refetch()}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user