'use client'
import type { GridResult } from '@/app/(admin)/ai/ocr-kombi/types'
interface WordRecognitionControlsProps {
gridResult: GridResult
isVocab: boolean
detecting: boolean
usedEngine: string
ocrEngine: string
setOcrEngine: (engine: 'auto' | 'tesseract' | 'rapid' | 'paddle') => void
pronunciation: 'british' | 'american'
setPronunciation: (p: 'british' | 'american') => void
gridMethod: 'v2' | 'words_first'
setGridMethod: (m: 'v2' | 'words_first') => void
gtNotes: string
setGtNotes: (notes: string) => void
gtSaved: boolean
runAutoDetection: () => void
handleGroundTruth: (isCorrect: boolean) => void
goToStep: (step: number) => void
onNext: () => void
}
export function WordRecognitionControls({
gridResult,
isVocab,
detecting,
usedEngine,
ocrEngine,
setOcrEngine,
pronunciation,
setPronunciation,
gridMethod,
setGridMethod,
gtNotes,
setGtNotes,
gtSaved,
runAutoDetection,
handleGroundTruth,
goToStep,
onNext,
}: WordRecognitionControlsProps) {
return (
{/* Grid method selector */}
{/* OCR Engine selector */}
{/* Pronunciation selector (only for vocab) */}
{isVocab && (
)}
{/* Show which engine was used */}
{usedEngine && (
{usedEngine === 'paddle' ? 'pp-ocrv5' : usedEngine}
)}
{/* Ground truth */}
{!gtSaved ? (
<>
setGtNotes(e.target.value)}
className="px-2 py-1 text-xs border rounded dark:bg-gray-700 dark:border-gray-600 w-48"
/>
>
) : (
Ground Truth gespeichert
)}
)
}