Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.5 KB
Raw Blame
import { useValues } from 'kea'

import { LemonSkeleton } from '@posthog/lemon-ui'

import { IntegrationView } from 'lib/integrations/IntegrationView'
import { getIntegrationConfig } from 'lib/integrations/organizationIntegrationConfig'

import { IntegrationType } from '~/types'

import { organizationIntegrationsLogic } from './organizationIntegrationsLogic'

export function OrganizationIntegrations(): JSX.Element | null {
    const { organizationIntegrations, organizationIntegrationsLoading } = useValues(organizationIntegrationsLogic)

    if (organizationIntegrationsLoading) {
        return (
            <div className="space-y-2">
                <LemonSkeleton className="h-16" />
                <LemonSkeleton className="h-16" />
            </div>
        )
    }

    if (!organizationIntegrations || organizationIntegrations.length === 0) {
        return null
    }

    return (
        <div className="space-y-2">
            {organizationIntegrations.map((integration: IntegrationType) => {
                const config = getIntegrationConfig(integration.kind)

                return (
                    <IntegrationView
                        key={integration.id}
                        integration={{
                            ...integration,
                            display_name: config.getDisplayName(integration),
                        }}
                        suffix={config.getSuffix(integration)}
                    />
                )
            })}
        </div>
    )
}