Restructure project to root layout

This commit is contained in:
beatz174-bit committed 2025-11-21 16:10:41 +10:00
1 parent e0e26a34ab
commit 3ffe9bbf99
51 files changed
+16 -12

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
import { Alert, Card, CardContent, Typography } from '@mui/material';
import { useBarcodeScanner } from '../hooks/useBarcodeScanner';
interface BarcodeScannerViewProps {
onDetected?: (code: string) => void;
}
export const BarcodeScannerView = ({ onDetected }: BarcodeScannerViewProps) => {
const { videoRef, result } = useBarcodeScanner();
if (result.code && onDetected) {
onDetected(result.code);
}
return (
<Card variant="outlined">
<CardContent>
<Typography variant="subtitle1" gutterBottom>
Scan Barcode
</Typography>
<video ref={videoRef} style={{ width: '100%', borderRadius: 8 }} />
{result.code ? <Alert severity="success">Detected {result.code}</Alert> : null}
{result.error ? <Alert severity="error">{result.error}</Alert> : null}
</CardContent>
</Card>
);
};