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

Function SidebarContent

packages/react/src/multiplayer/shell.tsx:344–421  ·  view source on GitHub ↗
(
  props: ShellProps & {
    pathname: string;
    onNavigate?: () => void;
    showBrand?: boolean;
    onOpenCommands: () => void;
    onOpenIntegrationConnect: () => 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 onOpenIntegrationConnect: () => void;
351 },
352) {
353 const plugins = useClientPlugins();
354 const pluginNavItems = plugins.flatMap((plugin) =>
355 (plugin.pages ?? []).flatMap((page) =>
356 page.nav
357 ? [
358 {
359 to: pluginPageNavPath(plugin.id, page.path),
360 label: page.nav.label,
361 },
362 ]
363 : [],
364 ),
365 );
366 const navItems = [...(props.navItems ?? defaultShellNavItems), ...pluginNavItems];
367 return (
368 <>
369 {props.showBrand !== false && (
370 <div className="flex h-12 shrink-0 items-center border-b border-sidebar-border px-4">
371 <Brand onNavigate={props.onNavigate} />
372 </div>
373 )}
374
375 <nav className="flex flex-1 flex-col overflow-y-auto p-2">
376 {navItems.map((item) => (
377 <NavItem
378 key={item.to}
379 to={item.to}
380 label={item.label}
381 active={item.to === "/" ? props.pathname === "/" : props.pathname.startsWith(item.to)}
382 onNavigate={props.onNavigate}
383 />
384 ))}
385
386 <div className="mt-5 mb-1 flex items-center justify-between px-2.5 text-xs font-medium uppercase tracking-widest text-muted-foreground">
387 <span>Integrations</span>
388 <Button
389 type="button"
390 variant="ghost"
391 size="icon-xs"
392 aria-label="Browse integrations"
393 title="Browse integrations"
394 onClick={props.onOpenIntegrationConnect}
395 className="-my-1 text-muted-foreground hover:bg-sidebar-active/60 hover:text-foreground"
396 >
397 <PlusIcon className="size-3.5" />
398 </Button>
399 </div>
400
401 <IntegrationList pathname={props.pathname} onNavigate={props.onNavigate} />

Callers

nothing calls this directly

Calls 2

useClientPluginsFunction · 0.90
pluginPageNavPathFunction · 0.85

Tested by

no test coverage detected