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

+21 -12
View File
@@ -49,6 +49,7 @@ import {
userDayKey,
validTimezoneOr,
} from "@/lib/tz/format";
import { EmptyState } from "@/components/ui/empty-state";
interface GeocodeResult {
lat: number;
@@ -343,9 +344,11 @@ export function EnvironmentSection() {
)}
</div>
) : (
<p className="text-muted-foreground text-sm">
{t("settings.sections.environment.home.none")}
</p>
<EmptyState
variant="plain"
size="compact"
title={t("settings.sections.environment.home.none")}
/>
)}
<form
className="flex gap-2"
@@ -378,9 +381,11 @@ export function EnvironmentSection() {
{homeSearched &&
!searchHome.isPending &&
homeResults.length === 0 && (
<p className="text-muted-foreground text-sm">
{t("settings.sections.environment.noResults")}
</p>
<EmptyState
variant="plain"
size="compact"
title={t("settings.sections.environment.noResults")}
/>
)}
{homeResults.length > 0 && (
<ul className="divide-border divide-y rounded-md border">
@@ -467,9 +472,11 @@ export function EnvironmentSection() {
))}
</ul>
) : (
<p className="text-muted-foreground text-sm">
{t("settings.sections.environment.travel.none")}
</p>
<EmptyState
variant="plain"
size="compact"
title={t("settings.sections.environment.travel.none")}
/>
)}
<form
@@ -505,9 +512,11 @@ export function EnvironmentSection() {
{travelSearched &&
!searchTravel.isPending &&
travelResults.length === 0 && (
<p className="text-muted-foreground text-sm">
{t("settings.sections.environment.noResults")}
</p>
<EmptyState
variant="plain"
size="compact"
title={t("settings.sections.environment.noResults")}
/>
)}
{travelResults.length > 0 && (
<ul className="divide-border divide-y rounded-md border">
@@ -29,6 +29,7 @@ import { useTranslations } from "@/lib/i18n/context";
import { queryKeys } from "@/lib/query-keys";
import { cn } from "@/lib/utils";
import type { InboundDocumentDto } from "@/lib/validations/inbound-documents";
import { EmptyState } from "@/components/ui/empty-state";
/** A picked document, carried by id + a display title (for the owner chips). */
export interface PickedDocument {
@@ -159,9 +160,11 @@ export function ShareDocumentPicker({
onRetry={() => list.refetch()}
/>
) : documents.length === 0 ? (
<p className="text-muted-foreground py-4 text-center text-sm">
{t("settings.sharing.pickerEmpty")}
</p>
<EmptyState
variant="plain"
size="compact"
title={t("settings.sharing.pickerEmpty")}
/>
) : (
<ul
className="max-h-[50vh] space-y-1.5 overflow-y-auto overscroll-contain"