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.

821 B
Raw Blame
import { LemonBanner } from '@posthog/lemon-ui'

import { EndpointVersionType } from '~/types'

interface VersionBannerProps {
    version: EndpointVersionType
    currentVersion: number
    onGoToLatest: () => void
}

export function VersionBanner({ version, currentVersion, onGoToLatest }: VersionBannerProps): JSX.Element | null {
    if (version.version === currentVersion) {
        return null
    }

    return (
        <LemonBanner
            type="warning"
            action={{
                children: 'Return to latest',
                onClick: onGoToLatest,
            }}
        >
            You are viewing version v{version.version}. You can still configure an old version, but to change the
            underlying query you will need to return to the latest version.
        </LemonBanner>
    )
}