show error message if no camera is present
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user