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, kea, key, path, props, reducers } from 'kea'

// Toolbar shim — the flag overview reads the feature flags API, which the toolbar can't reach on
// customer pages. The toolbar shows PropertyKeyInfo only for event names, never for `$feature/`
// keys, so the overview never renders here. The shim keeps PropertyKeyInfo out of the app zone.
export interface FeatureFlagSummaryLogicProps {
    flagKey: string
}

// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface featureFlagSummaryLogicValues {
    flagLoadFailed: boolean
    flagLoading: boolean
    summary: null
}

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

export type featureFlagSummaryLogicType = MakeLogicType<
    featureFlagSummaryLogicValues,
    {},
    FeatureFlagSummaryLogicProps,
    featureFlagSummaryLogicMeta
>

export const featureFlagSummaryLogic = kea<featureFlagSummaryLogicType>([
    props({} as FeatureFlagSummaryLogicProps),
    key((props) => props.flagKey),
    path((flagKey) => ['toolbar', 'shims', 'featureFlagSummaryLogic', flagKey]),
    reducers({
        flagLoadFailed: [false, {}],
        flagLoading: [false, {}],
        summary: [null, {}],
    }),
])