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

Function SidebarContent

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

useClientPluginsFunction · 0.90
pluginPageNavPathFunction · 0.85

Tested by

no test coverage detected