SPB Git

Repository Public

nav.ts 1.3 KB 25 lines typescript

1import { Activity, CircleDollarSign, FolderGit2, House, Inbox, Rocket, Settings, ShieldCheck } from 'lucide-react';23export const NAV = [4  { href: '/home/', label: 'Home', icon: House },5  { href: '/missions/', label: 'Missions', icon: Rocket },6  { href: '/approvals/', label: 'Approvals', icon: Inbox },7  { href: '/projects/', label: 'Projects', icon: FolderGit2 },8  { href: '/policy/', label: 'Policy', icon: ShieldCheck },9  { href: '/spend/', label: 'Spend', icon: CircleDollarSign },10  { href: '/system/', label: 'System', icon: Activity },11  { href: '/settings/', label: 'Settings', icon: Settings },12] as const;13export const NAV_GROUPS: { label: string; items: string[] }[] = [14  { label: 'Work', items: ['/home/', '/missions/', '/approvals/', '/projects/'] },15  { label: 'Control', items: ['/policy/', '/spend/', '/system/', '/settings/'] },16];17export const MOBILE_NAV = NAV.slice(0, 3);18export const MOBILE_MORE = NAV.slice(3);19export const TITLES: Record<string, string> = { ...Object.fromEntries(NAV.map((n) => [n.href, n.label])), '/mission/': 'Mission' };20/** Normalised path with a trailing slash; the mission detail page belongs to "Missions". */21export function activeHref(pathname: string): string {22  const p = pathname.endsWith('/') ? pathname : `${pathname}/`;23  return p === '/mission/' ? '/missions/' : p;24}25
Files main
Menu

Theme