INNER CODE UNIT · JavaScript
render
Dsadd4/AgentFigureGallery · frontend/reference_gallery/app.js:165
function render() {
updateCounts();
for (const button of el.filters) {
button.classList.toggle("active", button.dataset.filter === state.filter);
}
const candidates = visibleCandidates();
el.gallery.innerHTML = "";
if (!candidates.length) {
const empty = document.createElement("div");
empty.className = "empty";
empty.textContent = "No candidates match the current filters.";
el.gallery.appendChild(empty);
return;
}
const fragment = document.createDocumentFragment();
for (const candidate of candidates) {
fragment.appendChild(candidateCard(candidate));
}