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.

588 B
Raw Blame
import type { SignalViewApi } from 'products/today/frontend/generated/api.schemas'

import { scoutLabel, sourceStyle } from './todaySignalReports'

export function textOf(value: unknown): string | null {
    return typeof value === 'string' && value.trim() ? value.trim() : null
}

export function signalSourceLabel(signal: Pick<SignalViewApi, 'source_product' | 'extra'>): string {
    const label = sourceStyle(signal.source_product).label
    if (signal.source_product !== 'signals_scout') {
        return label
    }
    return scoutLabel(textOf(signal.extra.skill_name)) ?? label
}