/**
 * 统一的 EmptyState 组件
 * 用于显示空状态
 */
import React from "react";
import type { LucideIcon } from "lucide-react";
import { Button } from "../ui/Button";

export interface EmptyStateProps {
  icon?: LucideIcon;
  title: string;
  description?: string;
  action?: {
    label: string;
    onClick: () => void;
    icon?: LucideIcon;
  };
}

export const EmptyState: React.FC<EmptyStateProps> = ({
  icon: Icon,
  title,
  description,
  action,
}) => {
  return (
    <div className="text-center py-16 bg-white border border-slate-200 border-dashed rounded-lg">
      {Icon && <Icon className="w-16 h-16 mx-auto mb-4 text-gray-600" />}
      <h3 className="text-lg font-semibold text-slate-500 mb-2">{title}</h3>
      {description && (
        <p className="text-sm text-slate-500 mb-6">{description}</p>
      )}
      {action && (
        <Button
          variant="primary"
          icon={action.icon}
          onClick={action.onClick}
        >
          {action.label}
        </Button>
      )}
    </div>
  );
};

