// js/sidebar.js โ€” shared sidebar & topbar HTML injector // Include this after data.js and app.js in every authenticated page. // Call: renderShell(pageTitle, pageSubtitle) inside before main content. function renderShell(pageTitle, pageSubtitle = '') { const u = window.AMS ? AMS.currentUser : { name:'Arjun Sharma', role:'Asset Manager', avatar:'AS' }; const notifUnread = window.AMS ? AMS.notifications.filter(n=>!n.read).length : 0; const sidebarHTML = ` `; const topbarHTML = `
${pageTitle}${pageSubtitle?`${pageSubtitle}`:''}
๐Ÿšช
`; document.body.innerHTML = sidebarHTML + `
${topbarHTML}
` + document.body.innerHTML; } function markAllRead() { if (window.AMS) AMS.notifications.forEach(n => n.read = true); populateNotifBadge(); renderNotifPanel(); showToast('All caught up!','All notifications marked as read','success'); }