/* P.E.S.T Web App — Shell: sidebar (desktop) + topbar + bottom nav (mobile) */ function Shell({ route, setRoute, children }) { const store = useStore(); const me = store.member; const isAdmin = store.user.isAdmin; const mainPfp = (me.pfps && me.pfps.find((p) => p.img)) || (me.pfps && me.pfps[0]) || {}; const NAV = [ { key: "dashboard", label: "Dashboard", icon: window.AIcon.dashboard }, { key: "members", label: "Members", icon: window.AIcon.members }, { key: "projects", label: "Projects", icon: window.AIcon.projects }, { key: "votes", label: "Votes", icon: window.AIcon.vote }, ]; if (isAdmin) NAV.push({ key: "admin", label: "Admin", icon: window.AIcon.admin }); const Avatar = () => mainPfp.img ? {me.nick} :
{me.nick.slice(0, 2)}
; return (
{/* desktop sidebar */} {/* mobile topbar */}
P.E.S.T P.E.S.T
setRoute("profile")}>
{children}
{/* mobile bottom nav */}
); } window.Shell = Shell;