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 { MakeLogicType, actions, afterMount, kea, listeners, path, props } from 'kea'

import { toolbarPosthogJS } from '~/toolbar/shared/toolbarPosthogJS'

export interface ToolbarLockedFeatureLogicProps {
    featureName: string
}

// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface toolbarLockedFeatureLogicActions {
    reportViewPlansClicked: () => {
        value: true
    }
}

export type toolbarLockedFeatureLogicType = MakeLogicType<
    {},
    toolbarLockedFeatureLogicActions,
    ToolbarLockedFeatureLogicProps
>

export const toolbarLockedFeatureLogic = kea<toolbarLockedFeatureLogicType>([
    props({} as ToolbarLockedFeatureLogicProps),
    path(['toolbar', 'bar', 'toolbarLockedFeatureLogic']),
    actions({
        reportViewPlansClicked: true,
    }),
    listeners(({ props }) => ({
        reportViewPlansClicked: () => {
            toolbarPosthogJS.capture('toolbar locked feature view plans clicked', { feature: props.featureName })
        },
    })),
    afterMount(({ props }) => {
        toolbarPosthogJS.capture('toolbar locked feature viewed', { feature: props.featureName })
    }),
])