mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 22:02:16 +00:00
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:
1 parent
fe021c0ffd
commit
e7ee416e19
56 files changed
+353
-224
No files matched your search
@@ -9,6 +9,7 @@ import { apiGet } from "@/lib/api/api-fetch";
|
||||
import { useTranslations } from "@/lib/i18n/context";
|
||||
import { queryKeys } from "@/lib/query-keys";
|
||||
import type { ProfileSummaryPayload } from "@/lib/records/profile-summary";
|
||||
import { EmptyState } from "@/components/ui/empty-state";
|
||||
|
||||
function profileFactLabel(label: string, t: (key: string) => string): string {
|
||||
const keys: Record<string, string> = {
|
||||
@@ -61,9 +62,11 @@ export function ProfileSummary({
|
||||
))}
|
||||
</ul>
|
||||
) : (
|
||||
<p className="text-muted-foreground text-sm">
|
||||
{t("records.allergies.emptyTitle")}
|
||||
</p>
|
||||
<EmptyState
|
||||
variant="plain"
|
||||
size="compact"
|
||||
title={t("records.allergies.emptyTitle")}
|
||||
/>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
@@ -88,9 +91,11 @@ export function ProfileSummary({
|
||||
))}
|
||||
</ul>
|
||||
) : (
|
||||
<p className="text-muted-foreground text-sm">
|
||||
{t("records.family.emptyTitle")}
|
||||
</p>
|
||||
<EmptyState
|
||||
variant="plain"
|
||||
size="compact"
|
||||
title={t("records.family.emptyTitle")}
|
||||
/>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
@@ -112,9 +117,11 @@ export function ProfileSummary({
|
||||
))}
|
||||
</dl>
|
||||
) : (
|
||||
<p className="text-muted-foreground text-sm">
|
||||
{t("records.profileFacts.notRecorded")}
|
||||
</p>
|
||||
<EmptyState
|
||||
variant="plain"
|
||||
size="compact"
|
||||
title={t("records.profileFacts.notRecorded")}
|
||||
/>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
Reference in new issue
Block a user