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-full bg-slate-100 p-3 text-slate-400">
          <Icon className="h-6 w-6" />
        </div>
      )}
      <div className="text-sm font-medium text-slate-700">{title}</div>
      {description && <div className="max-w-sm text-xs text-slate-400">{description}</div>}
      {action && <div className="mt-2">{action}</div>}
    </div>
  )
}
