'use client' /** * GridOverlay Widgets - GridStats and GridLegend * * Extracted from GridOverlay.tsx to keep each file under 500 LOC. */ import { cn } from '@/lib/utils' import type { GridData } from './GridOverlay' /** * GridStats Component */ interface GridStatsProps { stats: GridData['stats'] deskewAngle?: number source?: string className?: string } export function GridStats({ stats, deskewAngle, source, className }: GridStatsProps) { const coveragePercent = Math.round(stats.coverage * 100) return (
Erkannt: {stats.recognized}
{(stats.manual ?? 0) > 0 && (
Manuell: {stats.manual}
)} {stats.problematic > 0 && (
Problematisch: {stats.problematic}
)}
Leer: {stats.empty}
Abdeckung: {coveragePercent}%
{deskewAngle !== undefined && deskewAngle !== 0 && (
Begradigt: {deskewAngle.toFixed(1)}
)} {source && (
Quelle: {source === 'tesseract+grid_service' ? 'Tesseract' : 'Vision LLM'}
)}
) } /** * Legend Component for GridOverlay */ export function GridLegend({ className }: { className?: string }) { return (
Erkannt
Problematisch
Manuell korrigiert
Leer
) }