export function getMiddlewareDescription(name: string): { icon: string; desc: string } {
  const descriptions: Record<string, { icon: string; desc: string }> = {
    request_id: { icon: '🆔', desc: 'Generiert eindeutige Request-IDs fuer Tracing' },
    security_headers: { icon: '🛡️', desc: 'Fuegt Security-Header hinzu (CSP, HSTS, etc.)' },
    cors: { icon: '🌐', desc: 'Cross-Origin Resource Sharing Konfiguration' },
    rate_limiter: { icon: '⏱️', desc: 'Rate Limiting zum Schutz vor Missbrauch' },
    pii_redactor: { icon: '🔒', desc: 'Redaktiert personenbezogene Daten in Logs' },
    input_gate: { icon: '🚪', desc: 'Validiert und sanitisiert Eingaben' },
  }
  return descriptions[name] || { icon: '⚙️', desc: 'Middleware-Komponente' }
}

export function getEventTypeColor(eventType: 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'
}
