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

import { IconPause, IconPlay } from '@posthog/icons'
import { Button } from '@posthog/quill'

import { autoresearchPipelineLogic } from '../autoresearchPipelineLogic'

export function QuillPipelineActions(): JSX.Element | null {
    const { pipeline, pipelineLoading } = useValues(autoresearchPipelineLogic)
    const { pausePipeline, resumePipeline } = useActions(autoresearchPipelineLogic)
    if (!pipeline) {
        return null
    }
    return (
        <>
            {pipeline.status === 'paused' ? (
                <Button
                    variant="outline"
                    onClick={() => resumePipeline()}
                    data-attr="autoresearch-model-resume"
                    loading={pipelineLoading}
                >
                    <IconPlay />
                    Resume
                </Button>
            ) : pipeline.status === 'running' ? (
                <Button
                    variant="outline"
                    onClick={() => pausePipeline()}
                    data-attr="autoresearch-model-pause"
                    loading={pipelineLoading}
                >
                    <IconPause />
                    Pause
                </Button>
            ) : null}
        </>
    )
}