show error message if no camera is present

This commit is contained in:
2025-08-11 01:52:41 +02:00
parent 1b37a99a2b
commit 6cec9f506a

View File

@@ -138,6 +138,14 @@ export default function Scanner({ onScan }: ScannerProps) {
return (
<div className="w-full max-w-2xl mx-auto">
{hasCamera === false ? (
<div className="p-4 text-center">
<p className="text-red-600 text-lg">
Denne nettsiden krever tilgang til et kamera.
</p>
</div>
) : (
<>
<div className={getVideoContainerClass()}>
<video
ref={videoRef}
@@ -270,6 +278,9 @@ export default function Scanner({ onScan }: ScannerProps) {
)}
</div>
</div>
</>
)}
<style jsx>{`
/* Responsive video container for mobile portrait */
@media (max-width: 768px) and (orientation: portrait) {