feat: build housekeeping command deck shell
This commit is contained in:
1 parent
cfeb0f19b8
commit
addc9c7b1a
9 files changed
+528
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
interface HousekeepingPageStateProps {
|
||||
state: "loading" | "empty" | "partial" | "error";
|
||||
title: string;
|
||||
description: string;
|
||||
retryAction?: ReactNode;
|
||||
}
|
||||
|
||||
export function HousekeepingPageState({
|
||||
state,
|
||||
title,
|
||||
description,
|
||||
retryAction,
|
||||
}: HousekeepingPageStateProps) {
|
||||
const isError = state === "error";
|
||||
const isPartial = state === "partial";
|
||||
|
||||
return (
|
||||
<section
|
||||
role={isError ? "alert" : "status"}
|
||||
aria-live={state === "loading" ? "polite" : undefined}
|
||||
className={`rounded-lg border p-4 ${
|
||||
isError
|
||||
? "border-[var(--admin-error)] bg-[var(--admin-surface)]"
|
||||
: isPartial
|
||||
? "border-[var(--admin-warning)] bg-[var(--admin-surface)]"
|
||||
: "border-[var(--admin-border)] bg-[var(--admin-surface)]"
|
||||
}`}
|
||||
>
|
||||
{isPartial ? (
|
||||
<p
|
||||
data-state-tone="warning"
|
||||
className="font-medium text-[var(--admin-warning)]"
|
||||
>
|
||||
{title}
|
||||
</p>
|
||||
) : (
|
||||
<h2 className="font-medium text-[var(--admin-text)]">{title}</h2>
|
||||
)}
|
||||
<p className="mt-1 text-sm text-[var(--admin-text-muted)]">
|
||||
{description}
|
||||
</p>
|
||||
{retryAction ? <div className="mt-3">{retryAction}</div> : null}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user