'use client' import React from 'react' interface SiteResult { url: string domain: string risk_level: string risk_score: number findings_count: number services_count: number has_impressum: boolean has_datenschutz: boolean has_cookie_banner: boolean has_google_fonts: boolean scan_status: string } const RISK_COLOR: Record = { MINIMAL: 'text-green-700 bg-green-50', LOW: 'text-yellow-700 bg-yellow-50', LIMITED: 'text-orange-700 bg-orange-50', HIGH: 'text-red-700 bg-red-50', UNACCEPTABLE: 'text-red-900 bg-red-100', } export function CompareResult({ sites }: { sites: SiteResult[] }) { if (!sites.length) return null const checks = [ { key: 'has_datenschutz', label: 'Datenschutzerklaerung' }, { key: 'has_impressum', label: 'Impressum' }, { key: 'has_cookie_banner', label: 'Cookie-Banner' }, { key: 'has_google_fonts', label: 'Google Fonts (lokal?)' }, ] return (
{sites.map((s, i) => ( ))} {sites.map((s, i) => ( ))} {sites.map((s, i) => ( ))} {sites.map((s, i) => ( ))} {checks.map(check => ( {sites.map((s, i) => { const val = (s as any)[check.key] const isInverted = check.key === 'has_google_fonts' const good = isInverted ? !val : val return ( ) })} ))}
Pruefung {s.domain}
Risiko-Score {s.risk_level || '?'} ({s.risk_score}/100)
Findings 0 ? 'text-red-700' : 'text-green-700'}`}> {s.findings_count}
Dienste erkannt{s.services_count}
{check.label} {good ? '✓' : '✗'}
) }