'use client'
/**
* StepGridReview Stats Bar & OCR Quality Controls
*
* Extracted from StepGridReview.tsx to stay under 500 LOC.
*/
import type { GridZone } from '@/components/grid-editor/types'
interface GridSummary {
total_zones: number
total_columns: number
total_rows: number
total_cells: number
}
interface DictionaryDetection {
is_dictionary: boolean
confidence: number
}
interface PageNumber {
text?: string
number?: number | null
}
interface ReviewStatsBarProps {
summary: GridSummary
dictionaryDetection?: DictionaryDetection | null
pageNumber?: PageNumber | null
lowConfCount: number
acceptedCount: number
totalRows: number
ocrEnhance: boolean
ocrMaxCols: number
ocrMinConf: number
visionFusion: boolean
documentCategory: string
durationSeconds: number
showImage: boolean
onOcrEnhanceChange: (v: boolean) => void
onOcrMaxColsChange: (v: number) => void
onOcrMinConfChange: (v: number) => void
onVisionFusionChange: (v: boolean) => void
onDocumentCategoryChange: (v: string) => void
onAcceptAll: () => void
onAutoCorrect: () => number
onToggleImage: () => void
}
export function ReviewStatsBar({
summary,
dictionaryDetection,
pageNumber,
lowConfCount,
acceptedCount,
totalRows,
ocrEnhance,
ocrMaxCols,
ocrMinConf,
visionFusion,
documentCategory,
durationSeconds,
showImage,
onOcrEnhanceChange,
onOcrMaxColsChange,
onOcrMinConfChange,
onVisionFusionChange,
onDocumentCategoryChange,
onAcceptAll,
onAutoCorrect,
onToggleImage,
}: ReviewStatsBarProps) {
return (
{summary.total_zones} Zone(n), {summary.total_columns} Spalten,{' '}
{summary.total_rows} Zeilen, {summary.total_cells} Zellen
{dictionaryDetection?.is_dictionary && (
Woerterbuch ({Math.round(dictionaryDetection.confidence * 100)}%)
)}
{pageNumber?.text && (
S. {pageNumber.number ?? pageNumber.text}
)}
{lowConfCount > 0 && (
{lowConfCount} niedrige Konfidenz
)}
{acceptedCount}/{totalRows} Zeilen akzeptiert
{acceptedCount < totalRows && (
)}
{/* OCR Quality Steps */}
|
|
{durationSeconds.toFixed(1)}s
)
}