import { Box, Button, Typography } from '@mui/material'
import type { ReactNode } from 'react'

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

export function EmptyState({ icon, title, description, action }: EmptyStateProps) {
  return (
    <Box className="flex flex-col items-center justify-center gap-3 py-16 px-8 text-center">
      {icon && <Box className="text-slate-400 mb-2">{icon}</Box>}
      <Typography variant="h6" color="text.primary" sx={{ fontWeight: 500 }}>{title}</Typography>
      {description && (
        <Typography variant="body2" color="text.secondary" className="max-w-sm">{description}</Typography>
      )}
      {action && (
        <Button variant="outlined" size="small" onClick={action.onClick} className="mt-2">
          {action.label}
        </Button>
      )}
    </Box>
  )
}
