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 { useValues } from 'kea'

import { useRequiredNotebookNode } from 'scenes/notebooks/Nodes/NotebookNodeContext'

import type { InsightLogicProps } from '~/types'

import { NotebookInsightDataframeFooter } from './NotebookInsightDataframeFooter'
import { InsightDataframeAttributes } from './notebookInsightDataframeLogic'

export function NotebookInsightDataframe({
    insightProps,
    attributes,
    updateAttributes,
}: {
    insightProps: InsightLogicProps
    attributes: InsightDataframeAttributes
    updateAttributes: (attributes: Partial<InsightDataframeAttributes>) => void
}): JSX.Element | null {
    const { notebookLogic, nodeId } = useValues(useRequiredNotebookNode())
    const { canEditNotebook, isShared } = useValues(notebookLogic)
    const enabled = canEditNotebook && !isShared
    if (!enabled) {
        return null
    }
    return (
        <NotebookInsightDataframeFooter
            notebookLogic={notebookLogic}
            nodeId={nodeId}
            insightProps={insightProps}
            attributes={attributes}
            updateAttributes={updateAttributes}
            enabled
        />
    )
}