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

Function IntegrationList

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

useIntegrationPluginsFunction · 0.90
integrationPresetIconUrlFunction · 0.90
integrationInferredUrlFunction · 0.90

Tested by

no test coverage detected