: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { useActions, useValues } from 'kea'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { Spinner } from 'lib/lemon-ui/Spinner'
import { notebookRunLogic } from './notebookRunLogic'
/**
* Progress for a whole-notebook run, above the document. Styled like the downstream-run banner
* on a cell, because it is the same kind of nudge rather than an error state.
*/
export const NotebookRunAllBanner = ({ shortId }: { shortId: string }): JSX.Element | null => {
const { isRunning, isInterrupting, progressLabel } = useValues(notebookRunLogic({ shortId }))
const { interruptRun } = useActions(notebookRunLogic({ shortId }))
if (!isRunning) {
return null
}
return (
<div className="mx-2 mt-1 flex flex-wrap items-center gap-2 rounded border border-accent bg-accent-highlight-secondary p-2 text-xs">
<Spinner textColored />
<span>{progressLabel ?? 'Starting the run'}</span>
<LemonButton
type="secondary"
size="xsmall"
onClick={() => interruptRun()}
loading={isInterrupting}
disabledReason={isInterrupting ? 'Stopping the run' : undefined}
data-attr="notebook-run-all-banner-stop"
>
Stop
</LemonButton>
</div>
)
}