diff --git a/components/scanner/ScannerCamera.js b/components/scanner/ScannerCamera.js index c4b2c78..ced464c 100644 --- a/components/scanner/ScannerCamera.js +++ b/components/scanner/ScannerCamera.js @@ -6,27 +6,63 @@ import ScannerScanPeek from './ScannerScanPeek.js'; import ScannerDisambiguation from './ScannerDisambiguation.js'; import { useScannerSound } from '../../lib/use-scanner-sound.js'; import { useScannerFlash } from '../../lib/use-scanner-flash.js'; +import { + cardGuideToContainerStyle, + computeObjectCoverLayout, + videoBoundsToContainerStyle, +} from '../../lib/scanner-video-layout.js'; const TOAST_DURATION_MS = 2500; -function DetectionFrame({ card, videoMetrics }) { +function CardGuideFrame({ layout }) { + if (!layout) return null; + + const style = cardGuideToContainerStyle(layout); + + return ( + + ); +} + +function DetectionFrame({ card, layout }) { const label = card.status === 'scanned' ? `Card ${card.id} scanned` : `Card ${card.id} identified`; + if (!layout) return null; + + const style = videoBoundsToContainerStyle(card.bounds, layout); + return (