fix: close housekeeping foundation review findings
This commit is contained in:
1 parent
ebc263da35
commit
08f8d54888
21 files changed
+593
-46
No files matched your search
@@ -1,14 +1,20 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
interface HousekeepingPageStateProps {
|
||||
state: "loading" | "empty" | "partial" | "error";
|
||||
interface HousekeepingPageStateBaseProps {
|
||||
title: string;
|
||||
description: string;
|
||||
retryAction?: ReactNode;
|
||||
}
|
||||
|
||||
type HousekeepingPageStateProps = HousekeepingPageStateBaseProps &
|
||||
(
|
||||
| { state: "partial"; partialLabel: string }
|
||||
| { state: "loading" | "empty" | "error"; partialLabel?: never }
|
||||
);
|
||||
|
||||
export function HousekeepingPageState({
|
||||
state,
|
||||
partialLabel,
|
||||
title,
|
||||
description,
|
||||
retryAction,
|
||||
@@ -31,13 +37,12 @@ export function HousekeepingPageState({
|
||||
{isPartial ? (
|
||||
<p
|
||||
data-state-tone="warning"
|
||||
className="font-medium text-[var(--admin-warning)]"
|
||||
className="mb-2 inline-flex rounded-full border border-[var(--admin-warning-border)] bg-[var(--admin-surface)] px-2 py-0.5 text-xs font-medium text-[var(--admin-warning)]"
|
||||
>
|
||||
{title}
|
||||
{partialLabel}
|
||||
</p>
|
||||
) : (
|
||||
<h2 className="font-medium text-[var(--admin-text)]">{title}</h2>
|
||||
)}
|
||||
) : null}
|
||||
<h2 className="font-medium text-[var(--admin-text)]">{title}</h2>
|
||||
<p className="mt-1 text-sm text-[var(--admin-text-muted)]">
|
||||
{description}
|
||||
</p>
|
||||
|
||||
Reference in new issue
Block a user