import { Box, Typography } from '@mui/material'
import type { ReminderPriority } from '../../domain/reminder'

const CONFIG: Record<ReminderPriority, { color: string; label: string }> = {
  URGENT: { color: '#dc2626', label: 'Dringend' },
  HIGH:   { color: '#ea580c', label: 'Hoch' },
  MEDIUM: { color: '#ca8a04', label: 'Mittel' },
  LOW:    { color: '#64748b', label: 'Niedrig' },
}

interface Props {
  priority: ReminderPriority
}

export function ReminderPriorityBadge({ priority }: Props) {
  const { color, label } = CONFIG[priority]
  return (
    <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.75 }}>
      <Box sx={{ width: 8, height: 8, borderRadius: '50%', bgcolor: color, flexShrink: 0 }} />
      <Typography variant="caption" sx={{ color, fontWeight: 600, fontSize: '0.7rem' }}>
        {label}
      </Typography>
    </Box>
  )
}
