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.

813 B
Raw Blame
import { useActions, useValues } from 'kea'
import type { ReactNode } from 'react'

import { TaskMenuItems } from 'products/posthog_ai/frontend/api/menus'

import { DROPDOWN_PARTS } from './todayMenuParts'
import { todayPanelTaskLogic } from './todayPanelTaskLogic'

interface TodayPanelTaskMenuItemsProps {
    taskId: string
    runId: string
    placement: ReactNode
}

export function TodayPanelTaskMenuItems({ taskId, runId, placement }: TodayPanelTaskMenuItemsProps): JSX.Element {
    const { task, run } = useValues(todayPanelTaskLogic({ taskId, runId }))
    const { archive } = useActions(todayPanelTaskLogic({ taskId, runId }))

    if (!task) {
        return <>{placement}</>
    }
    return <TaskMenuItems parts={DROPDOWN_PARTS} task={task} run={run} placement={placement} onArchive={archive} />
}