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.

746 B
Raw Blame
import { LemonTag, LemonTagType } from '@posthog/lemon-ui'

export type RunStatus = 'pending' | 'processing' | 'completed' | 'failed'

const STATUS_CONFIG: Record<RunStatus, { label: string; type: LemonTagType }> = {
    pending: { label: 'Pending', type: 'default' },
    processing: { label: 'Processing', type: 'highlight' },
    completed: { label: 'Completed', type: 'success' },
    failed: { label: 'Failed', type: 'danger' },
}

interface RunStatusBadgeProps {
    status: string
}

export function RunStatusBadge({ status }: RunStatusBadgeProps): JSX.Element {
    const config = STATUS_CONFIG[status as RunStatus] || { label: status, type: 'default' as LemonTagType }
    return <LemonTag type={config.type}>{config.label}</LemonTag>
}