'use client'

import { Button } from '@/components/ui/button'
import { DemoTooltip } from '@/components/shared/demo-tooltip'

interface EmptyPanelProps {
  title?: string
  message: string
  action?: {
    label: string
    onClick: () => void
    disabled?: boolean
  }
}

export function EmptyPanel({ title, message, action }: EmptyPanelProps) {
  return (
    <div className="p-8 text-center text-muted-foreground space-y-3">
      {title && <p className="text-sm font-medium text-foreground">{title}</p>}
      <p className="text-sm">{message}</p>
      {action && (
        <DemoTooltip show={action.disabled ?? false}>
          <Button
            size="sm"
            variant="outline"
            disabled={action.disabled}
            onClick={action.disabled ? undefined : action.onClick}
          >
            {action.label}
          </Button>
        </DemoTooltip>
      )}
    </div>
  )
}
