export default function EditarModal({ tipo, coord, show, close, setCoords }) { const handleSubmit = (e) => { e.preventDefault(); const formData = new FormData(e.target); const x = formData.get("x"); const y = formData.get("y"); const z = formData.get("z"); let storedTipo = localStorage.getItem(tipo); if (storedTipo) { let arr = JSON.parse(storedTipo); const index = arr.findIndex((item) => item.num === coord.num); if (index !== -1) { arr[index] = { ...coord, x: Number(x), y: y ? Number(y) : null, z: Number(z), }; localStorage.setItem(tipo, JSON.stringify(arr)); setCoords(arr); } } close(); }; if (!show) { return null; } return (
Update Coord
{coord.y != null && (
)}

); }