(
props: ShellProps & {
pathname: string;
onNavigate?: () => void;
showBrand?: boolean;
onOpenCommands: () => void;
},
)
| 341 | // ── SidebarContent ─────────────────────────────────────────────────────── |
| 342 | |
| 343 | function SidebarContent( |
| 344 | props: ShellProps & { |
| 345 | pathname: string; |
| 346 | onNavigate?: () => void; |
| 347 | showBrand?: boolean; |
| 348 | onOpenCommands: () => void; |
| 349 | }, |
| 350 | ) { |
| 351 | const plugins = useClientPlugins(); |
| 352 | const pluginNavItems = plugins.flatMap((plugin) => |
| 353 | (plugin.pages ?? []).flatMap((page) => |
| 354 | page.nav |
| 355 | ? [ |
| 356 | { |
| 357 | to: pluginPageNavPath(plugin.id, page.path), |
| 358 | label: page.nav.label, |
| 359 | }, |
| 360 | ] |
| 361 | : [], |
| 362 | ), |
| 363 | ); |
| 364 | const navItems = [...(props.navItems ?? defaultShellNavItems), ...pluginNavItems]; |
| 365 | return ( |
| 366 | <> |
| 367 | {props.showBrand !== false && ( |
| 368 | <div className="flex h-12 shrink-0 items-center border-b border-sidebar-border px-4"> |
| 369 | <Brand onNavigate={props.onNavigate} /> |
| 370 | </div> |
| 371 | )} |
| 372 | |
| 373 | <nav className="flex flex-1 flex-col overflow-y-auto p-2"> |
| 374 | {navItems.map((item) => ( |
| 375 | <NavItem |
| 376 | key={item.to} |
| 377 | to={item.to} |
| 378 | label={item.label} |
| 379 | active={item.to === "/" ? props.pathname === "/" : props.pathname.startsWith(item.to)} |
| 380 | onNavigate={props.onNavigate} |
| 381 | /> |
| 382 | ))} |
| 383 | |
| 384 | <div className="mt-5 mb-1 px-2.5 text-xs font-medium uppercase tracking-widest text-muted-foreground"> |
| 385 | <span>Integrations</span> |
| 386 | </div> |
| 387 | |
| 388 | <IntegrationList pathname={props.pathname} onNavigate={props.onNavigate} /> |
| 389 | </nav> |
| 390 | |
| 391 | <SidebarUpdateCard /> |
| 392 | |
| 393 | <div className="shrink-0 border-t border-sidebar-border p-2"> |
| 394 | <CommandsButton onOpen={props.onOpenCommands} /> |
| 395 | <DocsLink href={props.docsUrl ?? DEFAULT_DOCS_URL} onNavigate={props.onNavigate} /> |
| 396 | {APP_VERSION && ( |
| 397 | <p className="px-2.5 pt-1.5 font-mono text-[11px] text-muted-foreground tabular-nums"> |
| 398 | v{APP_VERSION} |
| 399 | </p> |
| 400 | )} |
nothing calls this directly
no test coverage detected