modified escaner
This commit is contained in:
@@ -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`);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -69,6 +69,14 @@
|
||||
}
|
||||
@media (max-width: 800px) {
|
||||
.yellowPart {
|
||||
left: 0;
|
||||
background: #bd8c01;
|
||||
transform: skew(0deg);
|
||||
}
|
||||
.header::after {
|
||||
left: -100px;
|
||||
}
|
||||
.header::before {
|
||||
left: -80px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user