'use client'; import { RefreshCw, XCircle, Search } from 'lucide-react'; interface CameraViewProps { scannerId: string; isStarted: boolean; paused?: boolean; error: string | null; hasZoom: boolean; zoom: number; maxZoom: number; onZoomChange: (newZoom: number) => Promise; countdown: number; ocrProcessing: boolean; isSelecting: boolean; capturedImage: string | null; detectedWords: Array<{ text: string; bbox: { x0: number; y0: number; x1: number; y1: number } }>; onScan?: () => void; onWordSelect: (text: string) => void; onCancelSelection: () => void; } export default function CameraView({ scannerId, isStarted, paused, error, hasZoom, zoom, maxZoom, onZoomChange, countdown, ocrProcessing, isSelecting, capturedImage, detectedWords, onScan, onWordSelect, onCancelSelection, }: CameraViewProps) { const cn = (...classes: any[]) => classes.filter(Boolean).join(' '); return (
{/* Video Viewport Area */}
{isStarted && !paused && !isSelecting && (
)}
{/* Selection UI */} {isSelecting && capturedImage && (
OCR text detection preview with detected words highlighted
{detectedWords.map((w, i) => (

Text Found

Tap any text to use it

)} {!isStarted && !error && (

Initializing camera...

)} {error && (

Camera Error

{error}

)}
{/* External Controls Area */}
{hasZoom && ( )}
{ocrProcessing ? ( <> Analyzing ) : ( <>
Smart Scan {countdown === 0 ? 'Scanning' : `${countdown}s`}
)} {/* Visual Progress Bar */}

Scanner active ยท Use zoom or tap scan

); }