()
| 45 | // --------------------------------------------------------------------------- |
| 46 | |
| 47 | export function IntegrationsPage() { |
| 48 | useExecutorDocumentTitle("Integrations"); |
| 49 | const integrations = useAtomValue(integrationsOptimisticAtom); |
| 50 | const refreshIntegrations = useAtomRefresh(integrationsOptimisticAtom); |
| 51 | |
| 52 | return ( |
| 53 | <PageContainer> |
| 54 | <PageHeader |
| 55 | title="Integrations" |
| 56 | description="Tool providers available in this workspace." |
| 57 | actions={ |
| 58 | <Button asChild size="sm" className="gap-1.5"> |
| 59 | <Link |
| 60 | to="/{-$orgSlug}/integrations/browse" |
| 61 | onClick={() => trackEvent("integration_browse_opened", { via: "header" })} |
| 62 | > |
| 63 | <PlusIcon className="size-4" /> |
| 64 | Add integration |
| 65 | </Link> |
| 66 | </Button> |
| 67 | } |
| 68 | /> |
| 69 | |
| 70 | <div className="mb-8"> |
| 71 | <McpInstallCard /> |
| 72 | </div> |
| 73 | |
| 74 | <div className="mb-8 border-t border-border/50" /> |
| 75 | |
| 76 | {isAsyncResultLoading(integrations) ? ( |
| 77 | <IntegrationsGridSkeleton /> |
| 78 | ) : ( |
| 79 | AsyncResult.match(integrations, { |
| 80 | onInitial: () => <IntegrationsGridSkeleton />, |
| 81 | onFailure: () => ( |
| 82 | <ErrorState message="Failed to load integrations" onRetry={refreshIntegrations} /> |
| 83 | ), |
| 84 | onSuccess: ({ value }) => { |
| 85 | if (value.length === 0) { |
| 86 | return <EmptyIntegrations />; |
| 87 | } |
| 88 | |
| 89 | return ( |
| 90 | <div className="mb-8 space-y-3"> |
| 91 | <IntegrationGrid integrations={value} /> |
| 92 | </div> |
| 93 | ); |
| 94 | }, |
| 95 | }) |
| 96 | )} |
| 97 | </PageContainer> |
| 98 | ); |
| 99 | } |
| 100 | |
| 101 | // --------------------------------------------------------------------------- |
| 102 | // Empty state |
nothing calls this directly
no test coverage detected