test
This commit is contained in:
parent
e0444f7ea3
commit
5543dca652
@ -10,6 +10,7 @@ import { Alert, AlertDescription } from '@/components/ui/alert';
|
|||||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import ConfirmDialog from '@/components/ConfirmDialog';
|
import ConfirmDialog from '@/components/ConfirmDialog';
|
||||||
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';
|
||||||
|
|
||||||
const TimeClockPage = () => {
|
const TimeClockPage = () => {
|
||||||
const videoRef = useRef(null);
|
const videoRef = useRef(null);
|
||||||
@ -346,15 +347,9 @@ const TimeClockPage = () => {
|
|||||||
</Alert>
|
</Alert>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{isScanning ? (
|
{/* Dialog for QR scanner preview */}
|
||||||
<div className="scanner-panel">
|
<Dialog>
|
||||||
<video ref={videoRef} className="scanner-video" playsInline muted />
|
<DialogTrigger asChild>
|
||||||
<div className="scanner-frame" aria-hidden="true" />
|
|
||||||
<Button onClick={stopScanner} variant="secondary" className="mt-2">
|
|
||||||
Annuler
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<Button
|
<Button
|
||||||
onClick={startScanner}
|
onClick={startScanner}
|
||||||
variant="default"
|
variant="default"
|
||||||
@ -362,7 +357,29 @@ const TimeClockPage = () => {
|
|||||||
>
|
>
|
||||||
{isAdmin ? "Pointer avec un QR code" : "Pointer"}
|
{isAdmin ? "Pointer avec un QR code" : "Pointer"}
|
||||||
</Button>
|
</Button>
|
||||||
|
</DialogTrigger>
|
||||||
|
<DialogContent className="max-w-2xl max-h-[90vh] overflow-auto">
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>Aperçu de la caméra</DialogTitle>
|
||||||
|
</DialogHeader>
|
||||||
|
{isScanning ? (
|
||||||
|
<div className="scanner-panel">
|
||||||
|
<video ref={videoRef} className="scanner-video w-full h-auto" playsInline muted />
|
||||||
|
<div className="scanner-frame" aria-hidden="true" />
|
||||||
|
<Button onClick={stopScanner} variant="secondary" className="mt-2">
|
||||||
|
Annuler
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="text-center py-8">
|
||||||
|
<p>La caméra est prête à être utilisée</p>
|
||||||
|
<Button onClick={startScanner} variant="default" className="mt-4">
|
||||||
|
Démarrer le scanner
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
{scanMessage && (
|
{scanMessage && (
|
||||||
<Alert variant="success" className="mb-4">
|
<Alert variant="success" className="mb-4">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user