'use client' import React, { useState } from 'react' interface ServiceInfo { name: string category: string provider: string country: string eu_adequate: boolean requires_consent: boolean legal_ref: string in_dse: boolean status: string } interface ScanFinding { code: string severity: string text: string correction: string } interface ScanData { pages_scanned: number services: ServiceInfo[] findings: ScanFinding[] ai_detected: boolean chatbot_detected: boolean chatbot_provider: string missing_pages: Record email_status: string } const STATUS_ICON: Record = { ok: { icon: '✓', color: 'text-green-600' }, undocumented: { icon: '✗', color: 'text-red-600' }, outdated: { icon: '~', color: 'text-yellow-600' }, } const SEV_STYLE: Record = { HIGH: { bg: 'bg-red-50 border-red-200', text: 'text-red-800' }, MEDIUM: { bg: 'bg-yellow-50 border-yellow-200', text: 'text-yellow-800' }, LOW: { bg: 'bg-blue-50 border-blue-200', text: 'text-blue-800' }, } export function ScanResult({ data }: { data: ScanData }) { const [expandedCorrection, setExpandedCorrection] = useState(null) const undocCount = data.services.filter(s => s.status === 'undocumented').length const okCount = data.services.filter(s => s.status === 'ok').length const outdatedCount = data.services.filter(s => s.status === 'outdated').length const highCount = data.findings.filter(f => f.severity === 'HIGH').length return (
{/* Summary Bar */}

{data.pages_scanned}

Seiten gescannt

{okCount}

Dokumentiert

{undocCount}

Nicht in DSE

{outdatedCount}

Veraltet

{/* AI / Chatbot Detection */}
{data.ai_detected ? 'KI erkannt' : 'Keine KI erkannt'} {data.chatbot_detected ? `Chatbot: ${data.chatbot_provider}` : 'Kein Chatbot'}
{/* Services Table */}

Dienstleister-Abgleich (SOLL/IST)

{data.services.map((s, i) => { const st = STATUS_ICON[s.status] || STATUS_ICON.ok return ( ) })}
Status Dienst Land EU In DSE
{st.icon} {s.name} {s.category} {s.country} {s.eu_adequate ? '✓' : '✗'} {s.in_dse ? 'Ja' : Nein}
{/* Findings */} {data.findings.length > 0 && (

Findings ({data.findings.length}, davon {highCount} kritisch)

{data.findings.map((f, i) => { const sev = SEV_STYLE[f.severity] || SEV_STYLE.MEDIUM const isExpanded = expandedCorrection === f.code return (
{f.severity}

{f.text}

{f.correction && (
{isExpanded && (
{f.correction}
)}
)}
) })}
)}
) }