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.1 KB
Raw Blame
import { useActions, useValues } from 'kea'

import { SlackDestinationPicker } from 'lib/components/Comments/SlackDestinationPicker'

import { slackDestinationLogic } from '../logics/slackDestinationLogic'
import type { TurnSuggestionLogicProps } from '../logics/turnSuggestionLogic'

export interface SlackDestinationSectionProps extends TurnSuggestionLogicProps {
    /** What connecting Slack buys the user on this card, shown when the project has no workspace yet. */
    connectHint: string
}

export function SlackDestinationSection({ connectHint, ...logicProps }: SlackDestinationSectionProps): JSX.Element {
    const logic = slackDestinationLogic(logicProps)
    const { slackIntegrationId, slackChannel } = useValues(logic)
    const { setSlackIntegrationId, setSlackChannel, connectSlackClicked } = useActions(logic)

    return (
        <SlackDestinationPicker
            integrationId={slackIntegrationId}
            channel={slackChannel}
            onIntegrationChange={setSlackIntegrationId}
            onChannelChange={setSlackChannel}
            notConfiguredDescription={connectHint}
            onConnectClick={connectSlackClicked}
        />
    )
}