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

Function SidebarContent

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

Source from the content-addressed store, hash-verified

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