Skip to content

Commit 4b5f23c

Browse files
committed
feat(ui): adopt ErrorState/EmptyState in app.index.tsx's metrics section
app.index.tsx's at-a-glance metrics section hand-rolled its own error and empty <div>s instead of the shared state-view primitives every other route uses. Swaps them for ErrorState/EmptyState from @/components/site/state-views, passing overview.error through as the error detail, with no change to the overview.status/series.length branching that decides which state renders. Closes #6983
1 parent 12d030f commit 4b5f23c

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

apps/loopover-ui/src/routes/app.index.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
2020

2121
import { StatusPill } from "@/components/site/control-primitives";
22+
import { EmptyState, ErrorState } from "@/components/site/state-views";
2223
import { PageHeader } from "@/components/site/primitives";
2324
import { TrendChart } from "@/components/site/trend-chart";
2425
import { type AppRole, useSession } from "@/lib/api/session";
@@ -169,14 +170,18 @@ function AppOverview() {
169170
className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3"
170171
>
171172
{overview.status === "error" && (
172-
<div className="col-span-full rounded-token border border-warning/30 bg-warning/[0.04] p-4 text-token-sm text-warning">
173-
App overview is unavailable right now ({overview.error}).
174-
</div>
173+
<ErrorState
174+
className="col-span-full"
175+
title="App overview is unavailable right now"
176+
description={overview.error}
177+
/>
175178
)}
176179
{series.length === 0 ? (
177-
<div className="col-span-full rounded-token border border-dashed border-border bg-transparent p-6 text-center text-token-sm text-muted-foreground">
178-
No metrics available yet. They’ll appear once the API returns data.
179-
</div>
180+
<EmptyState
181+
className="col-span-full"
182+
title="No metrics available yet"
183+
description="They’ll appear once the API returns data."
184+
/>
180185
) : (
181186
series.map((m) => (
182187
<SparkStat

0 commit comments

Comments
 (0)