From 96439b5367293ad0b6a3a92e8b8be05bfd8ba9ab Mon Sep 17 00:00:00 2001 From: rajun Date: Tue, 27 Oct 2026 16:28:55 +0530 Subject: [PATCH] feat: add scan QR dialog --- .../assets/detail/scan-qr-dialog.tsx | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 app/components/assets/detail/scan-qr-dialog.tsx diff --git a/app/components/assets/detail/scan-qr-dialog.tsx b/app/components/assets/detail/scan-qr-dialog.tsx new file mode 100644 index 0000000..34e6956 --- /dev/null +++ b/app/components/assets/detail/scan-qr-dialog.tsx @@ -0,0 +1,29 @@ +import { AssetQr } from '~/components/assets/asset-qr'; +import { CopyField } from '~/components/ui/copy-field'; +import { Dialog, DialogBody, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '~/components/ui/dialog'; +import { getArUrl } from '~/lib/assets/qr'; +import type { ArAsset } from '~/types/asset'; + +interface ScanQrDialogProps { + asset: ArAsset; + open: boolean; + onOpenChange: (open: boolean) => void; +} + +// AR needs a phone camera, so "View in your space" in the admin preview offers the QR code to scan instead +export function ScanQrDialog({ asset, open, onOpenChange }: ScanQrDialogProps) { + return ( + + + + View in AR + Scan this QR code with your phone’s camera to open {asset.name} and place it in your room. + + + + + + + + ); +}