import * as React from "react" import { StateView, type StateViewProps } from "@/components/feedback/state-view" import { Button, buttonVariants } from "@/components/ui/button" export type EmptyStateTone = "empty" | "error" | "info" export type EmptyStateAction = { label: React.ReactNode onClick?: () => void href?: string variant?: React.ComponentProps["variant"] } export type EmptyStateProps = Omit & { tone?: EmptyStateTone primaryAction?: EmptyStateAction secondaryAction?: EmptyStateAction compact?: boolean } function renderAction(action: EmptyStateAction, fallbackVariant: React.ComponentProps["variant"]) { if (action.href) return {action.label} return } /** @deprecated Use StateView. */ function EmptyState({ tone = "empty", primaryAction, secondaryAction, compact = false, ...props }: EmptyStateProps) { const actions = primaryAction || secondaryAction ? ( <> {secondaryAction ? renderAction(secondaryAction, "outline") : null} {primaryAction ? renderAction(primaryAction, "default") : null} ) : undefined return } export type ErrorStateProps = Omit /** @deprecated Use StateView with status="error". */ function ErrorState(props: ErrorStateProps) { return } export { EmptyState, ErrorState }