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 } from 'kea'

import { IconPlusSmall } from '@posthog/icons'

import { LemonButton } from 'lib/lemon-ui/LemonButton'

import { CreateKnowledgeSourceModal } from '../components/CreateKnowledgeSourceModal/CreateKnowledgeSourceModal'
import { REFRESH_INTERVAL_OPTIONS, businessKnowledgeLogic } from '../scenes/sources/businessKnowledgeLogic'

/**
 * "Add source" for the business knowledge empty state. The scene normally renders
 * the create modal, and the gate replaces the scene, so the empty state renders
 * the modal itself or the button would open nothing.
 */
export function BusinessKnowledgePrimaryAction(): JSX.Element {
    const { openCreateModal } = useActions(businessKnowledgeLogic)

    return (
        <>
            <LemonButton
                type="primary"
                className="self-start"
                icon={<IconPlusSmall />}
                onClick={() => openCreateModal()}
                data-attr="add-knowledge-source-button"
            >
                Add your first source
            </LemonButton>
            <CreateKnowledgeSourceModal refreshIntervalOptions={REFRESH_INTERVAL_OPTIONS} />
        </>
    )
}