import * as React from "react";
import { cn } from "@/lib/utils";
/**
* Reusable empty-state for lists, tiles, and chart panels that have no
* data yet. Always pair an icon, a one-sentence explanation, and a
* single primary action. Mounts inside the same container the loaded
* UI uses so the layout does not shift on first data.
*
* Pattern (per `docs/ui-guidelines.md` §4.2):
*
* }
* title={t("empty.measurements.title")}
* description={t("empty.measurements.description")}
* action={}
* />
*/
export interface EmptyStateProps extends Omit<
React.HTMLAttributes,
"title"
> {
icon?: React.ReactNode;
title: React.ReactNode;
description?: React.ReactNode;
action?: React.ReactNode;
/**
* `"card"` (default) wraps the empty-state in a bordered surface so
* it sits visually inside a list/tile.
* `"plain"` renders inline without the wrapper — for use inside
* chart panels that already have their own card.
*/
variant?: "card" | "plain";
/**
* Compact density for use inside tiles or table-row empty rows.
*/
size?: "default" | "compact";
}
function EmptyState({
icon,
title,
description,
action,
variant = "card",
size = "default",
className,
...props
}: EmptyStateProps) {
const inner = (