Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions web/dist/assets/index-B-n6FhZu.css

Large diffs are not rendered by default.

125 changes: 0 additions & 125 deletions web/dist/assets/index-CBozxdSC.js

This file was deleted.

125 changes: 125 additions & 0 deletions web/dist/assets/index-CyrqetI_.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion web/dist/assets/index-yRfiesog.css

This file was deleted.

4 changes: 2 additions & 2 deletions web/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Docker Commander</title>
<script type="module" crossorigin src="/assets/index-CBozxdSC.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-yRfiesog.css">
<script type="module" crossorigin src="/assets/index-CyrqetI_.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-B-n6FhZu.css">
</head>
<body>
<div id="root"></div>
Expand Down
36 changes: 32 additions & 4 deletions web/src/components/ui.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import clsx from "clsx";
import { Inbox } from "lucide-react";
import type { ReactNode } from "react";
import { stateColor } from "../lib/format";

Expand Down Expand Up @@ -63,11 +64,38 @@ export function StatCard({
);
}

export function EmptyState({ title, hint }: { title: string; hint?: string }) {
/**
* EmptyState is the "nothing here yet" placeholder.
*
* It is a bounded, dashed-outline panel rather than bare centred text: on a wide
* (QHD+) screen the content area is enormous, and two lines of muted text floating
* in the middle of it read as a rendering failure rather than as a deliberate
* empty list. The outline gives the eye something that obviously belongs there.
*
* `icon` and `action` are optional — pass an action when the page has an obvious
* next step, so the placeholder does the job the user came for.
*/
export function EmptyState({
title,
hint,
icon,
action,
}: {
title: string;
hint?: ReactNode;
icon?: ReactNode;
action?: ReactNode;
}) {
return (
<div className="text-center py-16 text-muted">
<div className="text-sm font-medium">{title}</div>
{hint && <div className="text-xs mt-1">{hint}</div>}
<div className="rounded-xl border border-dashed border-border bg-panel2/25 px-6 py-10">
<div className="mx-auto flex max-w-md flex-col items-center gap-2 text-center">
<div className="grid h-9 w-9 place-items-center rounded-lg border border-border bg-panel2 text-muted">
{icon ?? <Inbox className="h-4 w-4" />}
</div>
<div className="text-sm font-medium text-text">{title}</div>
{hint && <div className="text-xs text-muted">{hint}</div>}
{action && <div className="mt-2">{action}</div>}
</div>
</div>
);
}