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 { TodaySessionArchiveDialog } from './TodaySessionArchiveDialog'
import { TodaySessionHandoffDialog } from './TodaySessionHandoffDialog'
import { todaySessionMenuLogic } from './todaySessionMenuLogic'
import { TodaySessionMenuTarget } from './todayWorkItems'

/** The dialogs a session's actions open. The row or card that owns `target.menuId` renders them, so they outlive the menu. */
export function TodaySessionDialogs({ target }: { target: TodaySessionMenuTarget }): JSX.Element {
    const { handoffMenuId, archiveConfirmMenuId } = useValues(todaySessionMenuLogic)
    return (
        <>
            {target.canHandOff && handoffMenuId === target.menuId && (
                <TodaySessionHandoffDialog sessionId={target.sessionId} />
            )}
            {target.activeRunId && archiveConfirmMenuId === target.menuId && (
                <TodaySessionArchiveDialog
                    sessionId={target.sessionId}
                    title={target.title}
                    runId={target.activeRunId}
                />
            )}
        </>
    )
}