modified escaner

This commit is contained in:
2025-10-27 18:17:53 -06:00
parent 0df9aba20b
commit 374ce02350
3 changed files with 11 additions and 9 deletions
+1 -7
View File
@@ -47,16 +47,10 @@ export default function Dashboard() {
const encontrado = equipos.find((e) => e.id === code);
if (encontrado) {
// ✅ Si el equipo existe, redirige directamente
router.push(`/Editar?equipoId=${encontrado.id}`);
} else {
// 🚫 Si no existe, se puede registrar
const nombre = prompt("Equipo no registrado. Ingresa el nombre:");
if (nombre) {
const nuevoEquipo = { id: code, nombre, estado: "Disponible" };
setEquipos([...equipos, nuevoEquipo]);
alert("Equipo agregado al inventario");
}
router.push(`/AgregarEquipo`);
}
};
+8
View File
@@ -69,6 +69,14 @@
}
@media (max-width: 800px) {
.yellowPart {
left: 0;
background: #bd8c01;
transform: skew(0deg);
}
.header::after {
left: -100px;
}
.header::before {
left: -80px;
}
}
+2 -2
View File
@@ -46,7 +46,7 @@ export default function BarcodeScanner({ onScan }: BarcodeScannerProps) {
target: scannerRef.current,
constraints: {
width: 640,
height: 480,
height: 370,
facingMode: "environment",
},
},
@@ -114,4 +114,4 @@ export default function BarcodeScanner({ onScan }: BarcodeScannerProps) {
}}
/>
);
}
}