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.

1017 B
Raw Blame
import { LemonModal } from '@posthog/lemon-ui'

import { SDK } from '~/types'

import { SourceMapsSDKInstructions } from './source-maps/SourceMapsSDKInstructionsMap'

export function SourceMapsInstructionsModal({
    isOpen,
    onClose,
    sdk,
}: {
    isOpen: boolean
    onClose: () => void
    sdk?: SDK
}): JSX.Element {
    const sdkInstructions = sdk?.key
        ? SourceMapsSDKInstructions[sdk.key as keyof typeof SourceMapsSDKInstructions]
        : undefined

    const InstructionComponent = sdkInstructions as (() => JSX.Element) | undefined

    return (
        <LemonModal isOpen={isOpen} onClose={onClose} simple title="" zIndex="1161">
            <div className="overflow-y-auto p-6">
                {InstructionComponent && (
                    <div className="space-y-4">
                        <h2 className="text-2xl font-bold">{sdk?.name}</h2>
                        <InstructionComponent />
                    </div>
                )}
            </div>
        </LemonModal>
    )
}