/* hPanel left sidebar — grouped navigation, with a collapsed icon-rail mode. */ const { SidebarItem, SidebarGroupLabel, Icon: SbIcon } = window.HostingerHPanelDesignSystem_3ef285; const NAV = [ { group: null, items: [ { id: "home", icon: "home", label: "Home" }, { id: "build", icon: "sparkles", label: "Build a site" }, { id: "websites", icon: "window", label: "Websites", hasChildren: true }, { id: "domains", icon: "globe", label: "Domains", hasChildren: true }, { id: "emails", icon: "mail", label: "Emails" }, { id: "services", icon: "store", label: "More services", hasChildren: true }, ]}, { group: "Hostinger apps", items: [ { id: "horizons", icon: "layers", label: "Horizons" }, { id: "email-mkt", icon: "sparkles", label: "Email marketing" }, { id: "ecommerce", icon: "share", label: "Ecommerce" }, ]}, { group: "AI agents", items: [ { id: "agents", icon: "bot", label: "Agents" }, { id: "openclaw", icon: "circle-help", label: "OpenClaw" }, { id: "hermes", icon: "rocket", label: "Hermes Agent" }, ]}, { group: "Dev tools", items: [ { id: "vps", icon: "server", label: "VPS" }, { id: "gpu", icon: "cpu", label: "GPU" }, { id: "api", icon: "code", label: "API" }, ]}, ]; function ToggleBtn({ collapsed, onToggle }) { return ( (e.currentTarget.style.background = "var(--neutral-100)")} onMouseLeave={(e) => (e.currentTarget.style.background = "transparent")} > ); } function Sidebar({ active, onNavigate, collapsed, onToggle }) { if (collapsed) { const flat = NAV.flatMap((s) => s.items); return ( {flat.map((it) => { const on = active === it.id; return ( onNavigate && onNavigate(it.id)} title={it.label} aria-label={it.label} style={{ display: "inline-flex", alignItems: "center", justifyContent: "center", width: 44, height: 44, borderRadius: "var(--radius-md)", flex: "none", background: on ? "var(--neutral-0)" : "transparent", boxShadow: on ? "var(--shadow-sm)" : "none", color: on ? "var(--text-strong)" : "var(--text-muted)", border: "none", cursor: "pointer", transition: "background var(--dur-fast)", }} onMouseEnter={(e) => { if (!on) e.currentTarget.style.background = "var(--neutral-100)"; }} onMouseLeave={(e) => { if (!on) e.currentTarget.style.background = "transparent"; }} > ); })} ); } return ( {NAV.map((sec, i) => ( {sec.group && {sec.group}} {sec.items.map((it) => ( onNavigate && onNavigate(it.id)} /> ))} ))} ); } window.Sidebar = Sidebar;