: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 clsx from 'clsx'
import { TaskRunStatus } from '../types/taskTypes'
/** Run statuses that count as terminal. Mirrors desktop `isTerminalStatus`. */
export const TERMINAL_STATUSES: TaskRunStatus[] = [
TaskRunStatus.COMPLETED,
TaskRunStatus.FAILED,
TaskRunStatus.CANCELLED,
]
/** Small status dot: red for failed/cancelled, green for completed, pulsing blue while in motion. */
export function TaskRunStatusDot({ status }: { status: TaskRunStatus }): JSX.Element {
const terminal = TERMINAL_STATUSES.includes(status)
const color =
status === TaskRunStatus.FAILED || status === TaskRunStatus.CANCELLED
? 'bg-danger'
: terminal
? 'bg-success'
: 'bg-primary'
return (
<span
className={clsx('inline-block size-1.5 shrink-0 rounded-full', color, !terminal && 'animate-pulse')}
aria-hidden
/>
)
}