'use client' import React from 'react' import type { AnalysisResult as AnalysisResultType } from '../_hooks/useAgentAnalysis' const RISK_COLORS: Record = { low: { bg: 'bg-green-100', text: 'text-green-800', label: 'Niedrig' }, medium: { bg: 'bg-yellow-100', text: 'text-yellow-800', label: 'Mittel' }, high: { bg: 'bg-orange-100', text: 'text-orange-800', label: 'Hoch' }, critical: { bg: 'bg-red-100', text: 'text-red-800', label: 'Kritisch' }, unknown: { bg: 'bg-gray-100', text: 'text-gray-800', label: 'Unbekannt' }, } const DOC_TYPE_LABELS: Record = { privacy_policy: 'Datenschutzerklaerung', cookie_banner: 'Cookie-Banner', terms_of_service: 'AGB', imprint: 'Impressum', dpa: 'Auftragsverarbeitung (AVV)', other: 'Sonstiges', } interface Props { result: AnalysisResultType } export function AnalysisResult({ result }: Props) { const risk = RISK_COLORS[result.risk_level] || RISK_COLORS.unknown return (
{/* Header */}

{DOC_TYPE_LABELS[result.classification] || result.classification}

{result.url}

{risk.label} ({result.risk_score}/100)
{/* Role Assignment */}
Zugewiesen an: {result.responsible_role} Eskalationsstufe {result.escalation_level}
{/* Summary */} {result.summary && (

Zusammenfassung

{result.summary}

)} {/* Findings */} {result.findings.length > 0 && (

Findings ({result.findings.length})

    {result.findings.map((f, i) => (
  • ! {f}
  • ))}
)} {/* Required Controls */} {result.required_controls.length > 0 && (

Erforderliche Massnahmen

    {result.required_controls.map((c, i) => (
  • {c}
  • ))}
)} {/* Email Status */}
{result.email_status === 'sent' ? '✉ Email gesendet' : '✉ Email ausstehend'} {new Date(result.analyzed_at).toLocaleString('de-DE')}
) }