import type { ReactNode } from 'react'
import { cn } from '@/lib/cn'

export function EmptyState({
  icon: Icon,
  title,
  description,
  action,
  className,
}: {
  icon?: React.ComponentType<{ className?: string }>
  title: ReactNode
  description?: ReactNode
  action?: ReactNode
  className?: string
}) {
  return (
    <div className={cn('flex flex-col items-center justify-center gap-2 py-10 text-center', className)}>
      {Icon && (
        <div className="rounded-xl bg-slate-100 p-2.5 text-slate-400">
          <Icon className="h-5 w-5" />
        </div>
      )}
      <div className="text-[13px] font-semibold text-slate-700">{title}</div>
      {description && <div className="max-w-sm text-xs leading-relaxed text-slate-500">{description}</div>}
      {action && <div className="mt-2">{action}</div>}
    </div>
  )
}
