MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / SidebarContent

Function SidebarContent

packages/react/src/multiplayer/shell.tsx:344–409  ·  view source on GitHub ↗
(
  props: ShellProps & {
    pathname: string;
    onNavigate?: () => void;
    showBrand?: boolean;
    onOpenCommands: () => void;
  },
)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

useClientPluginsFunction · 0.90
pluginPageNavPathFunction · 0.85

Tested by

no test coverage detected