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.0 KB
Raw Blame
import { useActions, useValues } from 'kea'

import { userLogic } from 'scenes/userLogic'

import { wizardRunSyncLogic } from '../../logics/wizardRunSyncLogic'
import { wizardRunSidebarLogic } from './wizardRunSidebarLogic'
import { WizardRunSidebarWidgetView } from './WizardRunSidebarWidgetView'

export function WizardRunSidebarWidget({ projectId }: { projectId: string }): JSX.Element | null {
    const logic = wizardRunSyncLogic({ projectId })
    const { tasksByRunId } = useValues(logic)
    const { user } = useValues(userLogic)
    const sidebarLogic = wizardRunSidebarLogic({ projectId, userId: user?.id ?? 0 })
    const { visibleRuns } = useValues(sidebarLogic)
    const { clickState, dismissRuns } = useActions(sidebarLogic)
    return (
        <WizardRunSidebarWidgetView
            key={`${projectId}.${user?.id}`}
            runs={visibleRuns}
            tasksByRunId={tasksByRunId}
            onStateClick={() => clickState('navbar_sidebar')}
            onDismissRuns={dismissRuns}
        />
    )
}