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

import { Link } from 'lib/lemon-ui/Link'
import { urls } from 'scenes/urls'

import { BriefConfigModal } from '../BriefConfigModal'
import { pulseLogic } from '../pulseLogic'
import { RunBriefButton } from '../RunBriefButton'

/**
 * Create path for the Pulse empty state. The run button and the focus modal are what the
 * scene header offers, and the gate replaces the scene, so the empty state renders both
 * itself. The AI consent line replaces the scene's banner for the same reason.
 */
export function PulsePrimaryAction(): JSX.Element {
    const { showAiConsentBanner } = useValues(pulseLogic)
    const { openConfigModal } = useActions(pulseLogic)

    return (
        <div className="flex flex-col gap-2">
            <div className="flex flex-wrap items-center gap-2">
                <RunBriefButton />
                <span className="text-secondary text-sm">or</span>
                <Link onClick={() => openConfigModal(null)} data-attr="pulse-empty-state-new-config">
                    set a focus first
                </Link>
            </div>
            {showAiConsentBanner && (
                <span className="text-secondary text-xs">
                    Pulse runs AI over your project data. Approve AI data processing in{' '}
                    <Link to={urls.settings('organization-details', 'organization-ai-consent')}>
                        organization settings
                    </Link>{' '}
                    to run a brief.
                </span>
            )}
            <BriefConfigModal />
        </div>
    )
}