import { Chip } from '@mui/material'
import type { ReviewStatus } from '../../domain/enums'

const STATUS_META: Record<string, { label: string; color: string }> = {
  UNREVIEWED: { label: 'Ungeprüft',  color: '#94a3b8' },
  IN_REVIEW:  { label: 'In Prüfung', color: '#d97706' },
  APPROVED:   { label: 'Genehmigt',  color: '#1a7a4a' },
  REJECTED:   { label: 'Abgelehnt',  color: '#c0392b' },
  FLAGGED:    { label: 'Markiert',   color: '#ea580c' },
}

export function SignalReviewStatusBadge({ status }: { status?: ReviewStatus | null }) {
  const key = status ?? 'UNREVIEWED'
  const meta = STATUS_META[key] ?? { label: key, color: '#94a3b8' }
  return (
    <Chip
      label={meta.label}
      size="small"
      sx={{ bgcolor: meta.color, color: 'white', fontWeight: 600, fontSize: 10 }}
    />
  )
}
