"use client"; import Link from "next/link"; import type { ReactNode } from "react"; import { Inbox } from "lucide-react"; type EmptyStateAction = { /** Visible label for the call-to-action. */ label: string; /** If provided, renders a Next.js Link. Mutually exclusive with onClick. */ href?: string; /** If provided, renders a button. */ onClick?: () => void; }; type EmptyStateProps = { /** Optional icon element (typically a lucide-react icon). */ icon?: ReactNode; /** Required heading explaining the empty state. */ title: string; /** Optional supporting copy shown below the title. */ description?: string; /** Optional single primary action. */ action?: EmptyStateAction; /** Extra class names appended to the root. */ className?: string; }; /** * EmptyState — generic empty state for admin pages. * * Centers an icon + title + description and (optionally) a single primary CTA * styled with `.ha-btn-primary`. Uses the new admin design tokens for * colors and Fraunces for the title. */ export default function EmptyState({ icon, title, description, action, className = "", }: EmptyStateProps) { return (

{title}

{description && (

{description}

)} {action && (
)}
); } function DefaultEmptyIcon() { return ; } function EmptyStateActionButton({ action }: { action: EmptyStateAction }) { // Pick Link vs button based on whether an href is provided. Both render // with the same .ha-btn-primary class so the CTA is visually consistent. if (action.href) { return ( {action.label} ); } return ( ); }