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.

1.1 KB
Raw Blame
import { Link } from '@posthog/lemon-ui'

import { urls } from 'scenes/urls'

import { ProductKey } from '~/queries/schema/schema-general'

interface Props {
    /** Free-plan orgs have no limit to raise; they need billing in the first place. */
    onFreePlan: boolean
}

/**
 * Status and the way out in one line, shown once scanning has stopped.
 * Replaces `QuotaStatusLine` in that state rather than sitting under it.
 */
export function QuotaExhaustedNote({ onFreePlan }: Props): JSX.Element {
    const [status, linkText, suffix] = onFreePlan
        ? ['Free credits used up.', 'Add billing', 'to keep scanning.']
        : ['Spend limit reached.', 'Raise your billing limit', 'to resume scanning.']
    return (
        <div className="text-xs text-danger">
            {status}{' '}
            <Link
                data-attr="vision-open-billing-quota-exhausted"
                className="text-danger underline"
                to={urls.organizationBilling([ProductKey.REPLAY_VISION])}
            >
                {linkText}
            </Link>{' '}
            {suffix}
        </div>
    )
}