export function getMiddlewareDescription(name: string): { icon: string; desc: string } {
  const descriptions: Record<string, { icon: string; desc: string }> = {
    request_id: { icon: '\u{1F194}', desc: 'Generiert eindeutige Request-IDs fuer Tracing' },
    security_headers: { icon: '\u{1F6E1}\uFE0F', desc: 'Fuegt Security-Header hinzu (CSP, HSTS, etc.)' },
    cors: { icon: '\u{1F310}', desc: 'Cross-Origin Resource Sharing Konfiguration' },
    rate_limiter: { icon: '\u23F1\uFE0F', desc: 'Rate Limiting zum Schutz vor Missbrauch' },
    pii_redactor: { icon: '\u{1F512}', desc: 'Redaktiert personenbezogene Daten in Logs' },
    input_gate: { icon: '\u{1F6AA}', desc: 'Validiert und sanitisiert Eingaben' },
  }
  return descriptions[name] || { icon: '\u2699\uFE0F', desc: 'Middleware-Komponente' }
}

export function getEventTypeColor(eventType: string): string {
  if (eventType.includes('error') || eventType.includes('blocked') || eventType.includes('blacklist')) {
    return 'bg-red-100 text-red-800'
  }
  if (eventType.includes('warning') || eventType.includes('rate_limit')) {
    return 'bg-yellow-100 text-yellow-800'
  }
  if (eventType.includes('success') || eventType.includes('whitelist')) {
    return 'bg-green-100 text-green-800'
  }
  return 'bg-slate-100 text-slate-800'
}
