import type { ReactNode } from "react"; 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, }: HousekeepingPageStateProps) { const isError = state === "error"; const isPartial = state === "partial"; return (
{isPartial ? (

{partialLabel}

) : null}

{title}

{description}

{retryAction ?
{retryAction}
: null}
); }