async function loadLinks() { const container = document.getElementById('links-container'); if (!container) return; try { const response = await fetch('./assets/data/links.json'); if (!response.ok) { throw new Error(`Failed to load links: ${response.status}`); } const groups = await response.json(); // Helper function to fetch SVG content const fetchSvg = async (path) => { if (!path) return ''; try { const res = await fetch(path); if (!res.ok) return ''; return await res.text(); } catch (e) { console.error(`Failed to load SVG: ${path}`, e); return ''; } }; // Process groups and fetch SVGs in parallel const groupsWithSvgs = await Promise.all(groups.map(async (group) => { const groupIconSvg = await fetchSvg(group.iconPath); const linksWithSvgs = await Promise.all(group.links.map(async (link) => { const linkIconSvg = link.iconPath ? await fetchSvg(link.iconPath) : ''; return { ...link, iconSvg: linkIconSvg }; })); return { ...group, iconSvg: groupIconSvg, links: linksWithSvgs }; })); container.innerHTML = groupsWithSvgs.map(group => `