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

Function IntegrationList

packages/app/src/web/shell.tsx:104–159  ·  view source on GitHub ↗
(props: { pathname: string; onNavigate?: () => void })

Source from the content-addressed store, hash-verified

102// ── IntegrationList ───────────────────────────────────────────────────────────
103
104function IntegrationList(props: { pathname: string; onNavigate?: () => void }) {
105 const integrations = useAtomValue(integrationsOptimisticAtom);
106 const integrationPlugins = useIntegrationPlugins();
107
108 return AsyncResult.match(integrations, {
109 onInitial: () => <div className="px-2.5 py-2 text-xs text-muted-foreground">Loading…</div>,
110 onFailure: () => (
111 <div className="px-2.5 py-2 text-xs text-muted-foreground">No integrations yet</div>
112 ),
113 onSuccess: ({ value }: { readonly value: readonly Integration[] }) =>
114 value.length === 0 ? (
115 <div className="px-2.5 py-2 text-sm leading-relaxed text-muted-foreground">
116 No integrations yet
117 </div>
118 ) : (
119 <div className="flex flex-col gap-px">
120 {value.map((integration: Integration) => {
121 const slug = String(integration.slug);
122 const name = integration.name || slug;
123 const detailPath = `/integrations/${slug}`;
124 const active =
125 props.pathname === detailPath || props.pathname.startsWith(`${detailPath}/`);
126 return (
127 <Link
128 key={slug}
129 to="/{-$orgSlug}/integrations/$namespace"
130 params={{ namespace: slug }}
131 onClick={props.onNavigate}
132 className={[
133 "group flex items-center gap-2 rounded-md px-2.5 py-1.5 text-xs transition-colors",
134 active
135 ? "bg-sidebar-active text-foreground font-medium"
136 : "text-sidebar-foreground hover:bg-sidebar-active/60 hover:text-foreground",
137 ].join(" ")}
138 >
139 <IntegrationIconWithAccount
140 icon={integrationPresetIconUrl(
141 { id: slug, kind: integration.kind, name, url: integration.displayUrl },
142 integrationPlugins,
143 )}
144 integrationId={slug}
145 url={
146 integration.displayUrl ??
147 integrationInferredUrl({ id: slug, name }) ??
148 undefined
149 }
150 size="sm"
151 />
152 <span className="flex-1 truncate">{name}</span>
153 </Link>
154 );
155 })}
156 </div>
157 ),
158 });
159}
160
161// ── SidebarContent ───────────────────────────────────────────────────────

Callers

nothing calls this directly

Calls 3

useIntegrationPluginsFunction · 0.90
integrationPresetIconUrlFunction · 0.90
integrationInferredUrlFunction · 0.90

Tested by

no test coverage detected