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.

714 B
Raw Blame
import { Fragment } from 'react'

import { summarizeScopesByGroup } from 'lib/scopes'

export function ScopeGroupSummary({ scopes }: { scopes: readonly string[] }): JSX.Element {
    return (
        <div className="grid grid-cols-[auto_auto] gap-x-4 gap-y-0.5">
            {summarizeScopesByGroup(scopes).map(({ label, write, read }) => (
                <Fragment key={label}>
                    <span>{label}</span>
                    <span className="text-right whitespace-nowrap opacity-75">
                        {[write ? `${write} write` : null, read ? `${read} read` : null].filter(Boolean).join(' · ')}
                    </span>
                </Fragment>
            ))}
        </div>
    )
}