import type { ComponentType, ReactNode } from "react"; import Link from "next/link"; import { buttonVariants } from "@/components/ui/button"; import { cn } from "@/lib/utils"; type Action = { label: string; href: string; }; /** * Shared "nothing here yet" state — replaces the ad-hoc dashed-border boxes that used * to be copy-pasted per page (icon + one line of muted text, inconsistent spacing, * only some had a CTA). One consistent, warmer treatment: icon in a soft tinted * circle, a real heading instead of just a muted caption, and an optional primary/ * secondary action. */ export function EmptyState({ icon: Icon, title, description, action, secondaryAction, actionSlot, compact = false, className, }: { icon: ComponentType<{ className?: string }>; title: string; description?: string; action?: Action; secondaryAction?: Action; /** Arbitrary action element (e.g. a button that opens a dialog) instead of a plain Link. */ actionSlot?: ReactNode; /** Smaller variant for empty states nested inside a section rather than a full page. */ compact?: boolean; className?: string; }) { return (
{title}
{description && ({description}
)}