2026-03-16 23:20:54 +01:00
|
|
|
import { A, useLocation } from '@solidjs/router';
|
|
|
|
|
|
|
|
|
|
const links = [
|
|
|
|
|
{ href: '/admin/runtime-roles/new', label: 'Create Role' },
|
2026-03-16 23:30:37 +01:00
|
|
|
{ href: '/admin/runtime-roles', label: 'Manage Roles' },
|
2026-03-16 23:20:54 +01:00
|
|
|
{ href: '/admin/role-ui-configs/new', label: 'Create Dashboard' },
|
2026-03-16 23:30:37 +01:00
|
|
|
{ href: '/admin/role-ui-configs', label: 'Manage Dashboards' },
|
2026-03-16 23:20:54 +01:00
|
|
|
{ href: '/admin/onboarding-schemas/new', label: 'Create Onboarding Flow' },
|
2026-03-16 23:30:37 +01:00
|
|
|
{ href: '/admin/onboarding-schemas', label: 'Manage Onboarding Flows' },
|
2026-03-16 23:20:54 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export default function AdminSidebar() {
|
|
|
|
|
const location = useLocation();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<aside class="sidebar">
|
|
|
|
|
<div class="brand">
|
|
|
|
|
<img src="/nxtgauge-logo.png" alt="NXTGAUGE" />
|
|
|
|
|
</div>
|
2026-03-16 23:30:37 +01:00
|
|
|
{links.map((item) => {
|
|
|
|
|
const isActive =
|
|
|
|
|
location.pathname === item.href ||
|
|
|
|
|
(item.href !== '/admin/runtime-roles' &&
|
|
|
|
|
item.href !== '/admin/role-ui-configs' &&
|
|
|
|
|
item.href !== '/admin/onboarding-schemas' &&
|
|
|
|
|
location.pathname.startsWith(item.href.replace('/new', '')));
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<A href={item.href} class={`nav-item ${isActive ? 'active' : ''}`}>
|
|
|
|
|
{item.label}
|
|
|
|
|
</A>
|
|
|
|
|
);
|
|
|
|
|
})}
|
2026-03-16 23:20:54 +01:00
|
|
|
<p class="notice">Same UI flow, simpler builder experience.</p>
|
|
|
|
|
</aside>
|
|
|
|
|
);
|
|
|
|
|
}
|