refactor(ui): move 62 hand-written empty states onto EmptyState

The admin sections, the cycle, illness, medication, mood, records and
settings cards, the pickers and dialogs said nothing-here-yet in a
hand-written muted paragraph in five sizes and three alignments. List
and section states now render through EmptyState (plain, compact; the
three with a next step carry it as the action), and the six chart
bodies through ChartEmptyState at their former height. The thirteen
that stay are a field without a value or a hint inside an editor, not
a list state. The ratchet ceiling drops from 75 to 13.
This commit is contained in:
Marc-André Bombeck committed 2026-10-20 13:31:02 +02:00
1 parent fe021c0ffd
commit e7ee416e19
56 files changed
+353 -224

No files matched your search

+6 -3
View File
@@ -20,6 +20,7 @@ import {
HISTORY_REST_OPACITY,
HISTORY_PERIOD_OPACITY,
} from "./phase-tokens";
import { EmptyState } from "@/components/ui/empty-state";
/**
* v1.15.1 — the cycle-length history chart.
@@ -136,9 +137,11 @@ export function CycleHistoryChart({
</CardHeader>
<CardContent className="space-y-4">
{!hasData ? (
<p className="text-muted-foreground text-sm">
{t("cycle.history.none")}
</p>
<EmptyState
variant="plain"
size="compact"
title={t("cycle.history.none")}
/>
) : (
<>
{/* Stat chips — avg / variability / regularity classification. */}
@@ -10,6 +10,7 @@ import { CYCLE_SYMPTOM_CATALOG } from "./symptom-catalog";
import { PHASE_HUE } from "./phase-tokens";
import type { CyclePhase } from "./types";
import type { SymptomPhaseRow } from "./use-cycle";
import { EmptyState } from "@/components/ui/empty-state";
/**
* v1.15.0 — symptom patterns by phase (the cycle-NATIVE insight).
@@ -64,9 +65,11 @@ export function CycleSymptomPatterns({ rows }: CycleSymptomPatternsProps) {
</CardHeader>
<CardContent>
{rows.length === 0 ? (
<p className="text-muted-foreground text-sm">
{t("cycle.insights.symptomPatternsEmpty")}
</p>
<EmptyState
variant="plain"
size="compact"
title={t("cycle.insights.symptomPatternsEmpty")}
/>
) : (
<ul className="space-y-3" data-slot="cycle-symptom-pattern-list">
{rows.map((row) => {
+11 -6
View File
@@ -15,6 +15,7 @@ import { useTranslations, useFormatters } from "@/lib/i18n/context";
import type { Formatters } from "@/lib/format-locale";
import { FERTILE_HUE, FLOW_HUE, OVULATION_HUE } from "./phase-tokens";
import type { CyclePrediction, CycleHistoryResponse } from "./types";
import { EmptyState } from "@/components/ui/empty-state";
/**
* v1.15.0 — the predictions panel.
@@ -81,9 +82,11 @@ export function PredictionsPanel({
body={t("cycle.predictions.rawModeBody")}
/>
) : prediction == null ? (
<p className="text-muted-foreground text-sm">
{t("cycle.predictions.none")}
</p>
<EmptyState
variant="plain"
size="compact"
title={t("cycle.predictions.none")}
/>
) : prediction.stillLearning ? (
<>
<Learning
@@ -215,9 +218,11 @@ function HistoryCard({
</CardHeader>
<CardContent className="space-y-4">
{!stats || stats.avgLengthDays == null ? (
<p className="text-muted-foreground text-sm">
{t("cycle.history.none")}
</p>
<EmptyState
variant="plain"
size="compact"
title={t("cycle.history.none")}
/>
) : (
<dl className="grid grid-cols-2 gap-4 sm:grid-cols-3">
<Stat