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

@@ -40,6 +40,7 @@ import {
type NutrientCatalogEntryDto,
type SupplementLabelProposal,
} from "./use-composition";
import { EmptyState } from "@/components/ui/empty-state";
/** The categories the composition is offered for without being asked. */
export const COMPOSITION_CATEGORIES: ReadonlySet<string> = new Set([
@@ -520,9 +521,11 @@ export function CompositionSection({
}
>
{ingredients.length === 0 ? (
<p className="text-muted-foreground">
{t("medications.composition.empty")}
</p>
<EmptyState
variant="plain"
size="compact"
title={t("medications.composition.empty")}
/>
) : (
<div className="space-y-3">
<ul className="divide-border/60 divide-y" role="list">
@@ -37,6 +37,7 @@ import { ApiError, apiDelete, apiPatch, apiPost } from "@/lib/api/api-fetch";
import { formatDate } from "@/lib/date-format";
import { useDateFormatPreference, useTranslations } from "@/lib/i18n/context";
import { invalidateMedicationReads } from "@/lib/query-keys";
import { EmptyState } from "@/components/ui/empty-state";
/** The refusal codes the course routes answer, mapped to their copy. */
const REFUSAL_KEYS: Record<string, string> = {
@@ -262,9 +263,11 @@ export function CoursesRow({
</div>
{courses.length === 0 ? (
<p className="text-muted-foreground text-xs">
{t("medications.course.none")}
</p>
<EmptyState
variant="plain"
size="compact"
title={t("medications.course.none")}
/>
) : (
<ul className="space-y-2">
{courses.map((course, index) => (