`, so "no
* results" and "not started yet" and "the socket died" all look
* identical, and none of them is findable by role.
*
* Designed fresh rather than ported: the two repos that had a real
* `EmptyState` with typed variants were bambuddy and spoolbuddy,
* which are upstream projects rather than Kevin's code, so that
* evidence was withdrawn from the plan.
*
* The shape is deliberately flat — icon, heading, description,
* action — with **no variant enum**. An "empty" and an "error" empty
* state differ in wording and in whether there is a retry button,
* both of which are props already; a `variant="error"` that only
* changes a colour invites callers to encode meaning in the colour
* alone, which is the one thing a colour cannot carry.
*
* The heading is what makes it agent-drivable:
* `getByRole("heading", { name: "No discs queued" })` works, where
* `getByText` against eleven copies of "Nothing here" does not.
*/
export const EmptyState = ({
action,
className,
description,
heading,
headingLevel = 2,
icon,
size = "md",
...divProps
}: EmptyStateProps): ReactNode => {
const Heading = `h${headingLevel}` as const
return (
{/* The container and the thing querying it **cannot be the same
element** — a container query only matches descendants, so
`@container cq-md:px-8` on one `
` silently never fires.
Nothing errors, the padding just stays small forever. Hence
the wrapper: `className` stays on the outer element where a
consumer expects it, and the size classes move inside. */}
{icon ? (
{icon}
) : null}
{heading}
{description ? (
{description}
) : null}
{action ? (
{action}
) : null}
)
}