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

// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface addInsightToDashboardLogicValues {
    addInsightToDashboardModalVisible: boolean
    showMoreInsightTypes: boolean
}

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

export type addInsightToDashboardLogicType = MakeLogicType<
    addInsightToDashboardLogicValues,
    addInsightToDashboardLogicActions
>

export const addInsightToDashboardLogic = kea<addInsightToDashboardLogicType>([
    path(['scenes', 'dashboard', 'addInsightToDashboardLogic']),
    actions({
        showAddInsightToDashboardModal: true,
        hideAddInsightToDashboardModal: true,
        toggleShowMoreInsightTypes: true,
    }),
    reducers({
        addInsightToDashboardModalVisible: [
            false,
            {
                showAddInsightToDashboardModal: () => true,
                hideAddInsightToDashboardModal: () => false,
            },
        ],
        showMoreInsightTypes: [
            false,
            {
                toggleShowMoreInsightTypes: (state) => !state,
                hideAddInsightToDashboardModal: () => false,
            },
        ],
    }),
])