import type { ReactNode } from 'react' import { ChatIcon, ClockIcon, CubeIcon, KeyIcon, LockIcon, PuzzleIcon, RolesIcon, SettingsIcon, SlidersIcon, SyncIcon, UsersIcon, } from '../../../shared/icons.tsx' import { NavHeader, SectionNav } from '../../../shared/SectionNav.tsx' import { SidebarLayout } from '../../../shared/SidebarLayout.tsx' /** The sections in groups: who may use the app, what it runs, and how it runs. */ const groups = [ { label: 'People', sections: [ { to: '/admin/users', label: 'Users', icon: }, { to: '/admin/roles', label: 'Roles', icon: }, { to: '/admin/access', label: 'Access', icon: }, ], }, { label: 'Features', sections: [ { to: '/admin/plugins', label: 'Plugins', icon: }, { to: '/admin/models', label: 'Models', icon: }, ], }, { label: 'App', sections: [ { to: '/admin/general', label: 'General', icon: }, { to: '/admin/turns', label: 'Turns', icon: }, { to: '/admin/sync', label: 'Sync', icon: }, { to: '/admin/api-keys', label: 'API keys', icon: }, { to: '/admin/cron', label: 'Cron', icon: }, ], }, ] as const const settings = [{ to: '/settings', label: 'Settings', icon: }] as const interface Props { children: ReactNode } export function AdminLayout(props: Props) { return ( {groups.map((group) => ( // A plugin's own page counts as the plugins section. ))} } > {props.children} ) }