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

Function IntegrationList

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

useIntegrationPluginsFunction · 0.90
integrationPresetIconUrlFunction · 0.90
integrationInferredUrlFunction · 0.90

Tested by

no test coverage detected