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.3 KB
Raw Blame
import { MakeLogicType, actions, kea, key, path, props, reducers } from 'kea'

export enum OutputTab {
    Results = 'results',
    Visualization = 'visualization',
    Both = 'both',
}

export interface OutputTabProps {
    tabId: string
}

// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface outputPaneLogicValues {
    activeTab: OutputTab
}

// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface outputPaneLogicActions {
    setActiveTab: (tab: OutputTab) => {
        tab: OutputTab
    }
}

// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface outputPaneLogicMeta {
    key: string
}

export type outputPaneLogicType = MakeLogicType<
    outputPaneLogicValues,
    outputPaneLogicActions,
    OutputTabProps,
    outputPaneLogicMeta
>

export const outputPaneLogic = kea<outputPaneLogicType>([
    path(['data-warehouse', 'editor', 'outputPaneLogic']),
    props({} as OutputTabProps),
    key((props) => props.tabId),
    actions({
        setActiveTab: (tab: OutputTab) => ({ tab }),
    }),
    reducers({
        activeTab: [
            OutputTab.Results as OutputTab,
            {
                setActiveTab: (_, { tab }) => tab,
            },
        ],
    }),
])