import * as React from "react"; import type { LucideIcon } from "lucide-react"; import { Button } from "./button"; import { hasSlot, renderActions, type ActionData } from "./data-slots"; import { Skeleton } from "./skeleton"; import { cn } from "../lib/cn"; type LegacyCta = { label: string; onClick: () => void; disabled?: boolean; }; export interface EmptyStateProps { /** One of the brand's illustrations: the path of an image under `public/` * (`/img/illustrations/welcome.svg`; shown at 180px with empty alt text, * the title says it all), or an element for anything else. */ illustration?: string | React.ReactNode; title: React.ReactNode; text?: React.ReactNode; /** Buttons, main one first, as elements or `ActionData`. Children go * there too. */ actions?: React.ReactNode | ActionData | ActionData[]; children?: React.ReactNode; /** 2 by default. */ headingLevel?: 1 | 2 | 3; className?: string; // What the component took before the design system's names. The pages not // yet restyled still pass these; a restyled page uses the ones above. /** @deprecated Pass `illustration`. */ icon?: LucideIcon; /** @deprecated Pass `text`. */ description?: React.ReactNode; /** @deprecated Pass `actions`. */ cta?: LegacyCta; /** @deprecated Pass `actions`. Only shown when `cta` is too. */ secondaryCta?: LegacyCta; } export function EmptyStateSkeleton() { return (
{sentence}
)}