diff --git a/public/js/components/navbar-admin.js b/public/js/components/navbar-admin.js new file mode 100644 index 00000000..a3d248ad --- /dev/null +++ b/public/js/components/navbar-admin.js @@ -0,0 +1 @@ +(function(){const u=JSON.parse(localStorage.getItem('admin_user')||'{}');const n=u.name||u.email||'Admin';const e=document.getElementById('admin-navbar');if(!e)return;const t=e.dataset.pageTitle||'Admin';const i=e.dataset.pageIcon||'default';const d=window.location.pathname.includes('dashboard.html');const icons={default:'',blog:'',newsletter:''};const s=icons[i]||icons.default;const b=d?'':``;e.innerHTML=``;document.getElementById('admin-logout-btn').addEventListener('click',()=>{localStorage.removeItem('admin_token');localStorage.removeItem('admin_user');window.location.href='/admin/login.html';});})();