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

const CONFIG: Record<ReviewPriority, { label: string; color: string }> = {
  LOW:      { label: 'Niedrig',  color: '#64748b' },
  MEDIUM:   { label: 'Mittel',   color: '#d97706' },
  HIGH:     { label: 'Hoch',     color: '#ea580c' },
  CRITICAL: { label: 'Kritisch', color: '#c0392b' },
}

interface Props {
  priority: ReviewPriority
  size?: 'small' | 'medium'
}

export function ReviewPriorityBadge({ priority, size = 'small' }: Props) {
  const { label, color } = CONFIG[priority] ?? CONFIG.MEDIUM
  return <GenericBadge label={label} color={color} showBorder bold size={size} />
}
