import { GenericBadge } from '../shared/GenericBadge'
import type { ReviewTaskStatus } from '../../domain/review'

const CONFIG: Record<ReviewTaskStatus, { label: string; color: string }> = {
  PENDING:         { label: 'Ausstehend',      color: '#d97706' },
  IN_REVIEW:       { label: 'In Prüfung',      color: '#2563eb' },
  APPROVED:        { label: 'Genehmigt',       color: '#1a7a4a' },
  REJECTED:        { label: 'Abgelehnt',       color: '#c0392b' },
  NEEDS_MORE_DATA: { label: 'Mehr Daten nötig', color: '#7c3aed' },
  ESCALATED:       { label: 'Eskaliert',       color: '#ea580c' },
}

interface Props {
  status: ReviewTaskStatus
  size?: 'small' | 'medium'
}

export function ReviewStatusBadge({ status, size = 'small' }: Props) {
  const { label, color } = CONFIG[status] ?? CONFIG.PENDING
  return <GenericBadge label={label} color={color} showBorder size={size} />
}
