import type { LucideIcon } from "lucide-react"; import { AlertTriangle, Inbox, RotateCw } from "lucide-react"; import type { ReactNode } from "react"; import { Button } from "~/components/ui/button.tsx"; import { cn } from "~/lib/utils.ts"; /** 空态:图标 + 标题 + 说明 + 可选操作。用于"尚无数据"与"功能建设中"占位 */ export function EmptyState({ icon: Icon = Inbox, title, description, action, plain = false, className, }: { icon?: LucideIcon; title: string; description?: ReactNode; action?: ReactNode; /** 放在已有卡片内时用 plain,避免玻璃叠玻璃 */ plain?: boolean; className?: string; }) { return (
{title}
{description ?{description}
: null} {action ?{title}
{message ?{message}
: null} {onRetry ? ( ) : null}