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

Function IntegrationList

packages/react/src/multiplayer/shell.tsx:186–249  ·  view source on GitHub ↗
(props: { pathname: string; onNavigate?: () => void })

Source from the content-addressed store, hash-verified

184
185// `pathname` is scope-relative (org-slug prefix already stripped).
186function IntegrationList(props: { pathname: string; onNavigate?: () => void }) {
187 const integrations = useAtomValue(integrationsOptimisticAtom);
188 const integrationPlugins = useIntegrationPlugins();
189
190 return AsyncResult.match(integrations, {
191 onInitial: () => (
192 <div className="flex flex-col gap-1 px-2.5 py-1">
193 {[80, 65, 72, 58, 68].map((w, i) => (
194 <div key={i} className="flex items-center gap-2 rounded-md py-1.5">
195 <Skeleton className="size-3.5 shrink-0 rounded" />
196 <Skeleton className="h-3" style={{ width: `${w}%` }} />
197 </div>
198 ))}
199 </div>
200 ),
201 onFailure: () => (
202 <div className="px-2.5 py-2 text-xs text-muted-foreground">No integrations yet</div>
203 ),
204 onSuccess: ({ value }) =>
205 value.length === 0 ? (
206 <div className="px-2.5 py-2 text-sm leading-relaxed text-muted-foreground">
207 No integrations yet
208 </div>
209 ) : (
210 <div className="flex flex-col gap-px">
211 {value.map((integration: Integration) => {
212 const slug = String(integration.slug);
213 const name = integration.name || slug;
214 const detailPath = `/integrations/${slug}`;
215 const active =
216 props.pathname === detailPath || props.pathname.startsWith(`${detailPath}/`);
217 return (
218 <Link
219 key={slug}
220 to="/{-$orgSlug}/integrations/$namespace"
221 params={{ namespace: slug }}
222 onClick={props.onNavigate}
223 className={[
224 "group flex items-center gap-2 rounded-md px-2.5 py-1.5 text-xs transition-colors",
225 active
226 ? "bg-sidebar-active text-foreground font-medium"
227 : "text-sidebar-foreground hover:bg-sidebar-active/60 hover:text-foreground",
228 ].join(" ")}
229 >
230 <IntegrationFavicon
231 icon={integrationPresetIconUrl(
232 { id: slug, kind: integration.kind, name, url: integration.displayUrl },
233 integrationPlugins,
234 )}
235 integrationId={slug}
236 url={
237 integration.displayUrl ??
238 integrationInferredUrl({ id: slug, name }) ??
239 undefined
240 }
241 />
242 <span className="flex-1 truncate">{name}</span>
243 </Link>

Callers

nothing calls this directly

Calls 3

useIntegrationPluginsFunction · 0.90
integrationPresetIconUrlFunction · 0.90
integrationInferredUrlFunction · 0.90

Tested by

no test coverage detected