'use client';

import { ReactNode } from 'react';
import { FileText, Search } from 'lucide-react';

interface EmptyStateProps {
  message?: string;
  description?: string;
  icon?: ReactNode;
  action?: { label: string; onClick: () => void };
}

export default function EmptyState({
  message = 'No records found',
  description,
  icon,
  action,
}: EmptyStateProps) {
  return (
    <div className="flex flex-col items-center justify-center gap-3 rounded-xl border border-white/10 bg-white/[0.02] py-10">
      <div className="rounded-full bg-white/5 p-3 text-slate-400">
        {icon ?? (description ? <Search className="h-6 w-6" /> : <FileText className="h-6 w-6" />)}
      </div>
      <p className="text-sm font-medium text-slate-300">{message}</p>
      {description && <p className="text-xs text-slate-500 text-center max-w-xs">{description}</p>}
      {action && (
        <button
          onClick={action.onClick}
          className="rounded-lg border border-white/10 px-4 py-2 text-sm text-slate-300 hover:bg-white/5"
        >
          {action.label}
        </button>
      )}
    </div>
  );
}
