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.

684 B
Raw Blame
import { LemonTagType } from 'lib/lemon-ui/LemonTag'

import { ReviewModeEnumApi, type StamphogRepoConfigApi } from '../../generated/api.schemas'
import { REVIEW_MODE_LABELS } from '../../reviewModeLabels'

export function repoStatusDisplay(repo: StamphogRepoConfigApi): { type: LemonTagType; label: string } {
    if (repo.enabled) {
        return { type: 'success', label: 'Reviewing' }
    }
    return { type: 'muted', label: 'Paused' }
}

export function triggerSummary(repo: StamphogRepoConfigApi): string {
    if (repo.review_mode === ReviewModeEnumApi.Label) {
        return `Label: ${repo.trigger_label ?? ''}`
    }
    return REVIEW_MODE_LABELS[ReviewModeEnumApi.All]
}