'use client' import React from 'react' import type { VocabWorksheetHook } from '../types' export function OcrComparisonModal({ h }: { h: VocabWorksheetHook }) { const { isDark, glassCard } = h return (
{/* Header */}

OCR-Methoden Vergleich

Seite {h.ocrComparePageIndex !== null ? h.ocrComparePageIndex + 1 : '-'}

{/* Loading State */} {h.isComparingOcr && (

Vergleiche OCR-Methoden... (kann 1-2 Minuten dauern)

)} {/* Error State */} {h.ocrCompareError && (
Fehler: {h.ocrCompareError}
)} {/* Results */} {h.ocrCompareResult && !h.isComparingOcr && (
{/* Method Results Grid */}
{Object.entries(h.ocrCompareResult.methods || {}).map(([key, method]: [string, any]) => (

{method.name}

{h.ocrCompareResult.recommendation?.best_method === key && ( Beste )}
{method.success ? ( <>
{method.vocabulary_count} Vokabeln in {method.duration_seconds}s
{method.vocabulary && method.vocabulary.length > 0 && (
{method.vocabulary.slice(0, 10).map((v: any, idx: number) => (
{v.english} = {v.german}
))} {method.vocabulary.length > 10 && (
+ {method.vocabulary.length - 10} weitere...
)}
)} ) : (
{method.error || 'Fehler'}
)}
))}
{/* Comparison Summary */} {h.ocrCompareResult.comparison && (

Uebereinstimmung

Von allen erkannt: {h.ocrCompareResult.comparison.found_by_all_methods?.length || 0}
Nur teilweise: {h.ocrCompareResult.comparison.found_by_some_methods?.length || 0}
Gesamt einzigartig: {h.ocrCompareResult.comparison.total_unique_vocabulary || 0}
Uebereinstimmung: {Math.round((h.ocrCompareResult.comparison.agreement_rate || 0) * 100)}%
)}
)}
) }