// === GRID VIEW === function renderGrid() { const el = document.getElementById("grid-view"); const filtered = filterTags(); if (!filtered.length) { el.innerHTML = '
:/
No se encontraron tags
'; return; } el.innerHTML = filtered.map(tag => { const img = getImg(tag); const ref = (tag.ref || "").toUpperCase(); const ph = ref.slice(0, 2); const sel = state.selected.has(tag.mrf); return `
${img ? `${ref}` : `
${ph}
`}
${ref}
${getName(tag)}
`; }).join(""); el.querySelectorAll(".card").forEach(c => { c.onclick = () => state.selectionMode ? toggleSel(c.dataset.mrf) : showDetail(c.dataset.mrf); }); }