import { Box, Typography } from '@mui/material'
import {
  FileText,
  ArrowRightLeft,
  TrendingUp,
  ClipboardCheck,
  Shield,
  Wrench,
  Eye,
  Tag,
} from 'lucide-react'
import type { LucideIcon } from 'lucide-react'
import type { ReminderType } from '../../domain/reminder'

const CONFIG: Record<ReminderType, { Icon: LucideIcon; label: string; color: string }> = {
  LEASE_EXPIRY:         { Icon: FileText,       label: 'Mietablauf',       color: '#152642' },
  BREAK_OPTION:         { Icon: ArrowRightLeft,  label: 'Break-Option',     color: '#7c3aed' },
  RENT_REVIEW:          { Icon: TrendingUp,      label: 'Mietanpassung',    color: '#0369a1' },
  INSPECTION:           { Icon: ClipboardCheck,  label: 'Inspektion',       color: '#065f46' },
  INSURANCE_RENEWAL:    { Icon: Shield,          label: 'Versicherung',     color: '#92400e' },
  MAINTENANCE:          { Icon: Wrench,          label: 'Unterhalt',        color: '#374151' },
  SCHATTENMARKT_RELEASE:{ Icon: Eye,             label: 'Pre-Market',       color: '#be185d' },
  CUSTOM:               { Icon: Tag,             label: 'Individuell',      color: '#64748b' },
}

interface Props {
  type: ReminderType
  compact?: boolean
}

export function ReminderTypeBadge({ type, compact = false }: Props) {
  const { Icon, label, color } = CONFIG[type]
  return (
    <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
      <Icon size={compact ? 12 : 14} color={color} />
      {!compact && (
        <Typography variant="caption" sx={{ color, fontWeight: 500, fontSize: '0.75rem', whiteSpace: 'nowrap' }}>
          {label}
        </Typography>
      )}
    </Box>
  )
}
