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.

804 B
Raw Blame
import { useValues } from 'kea'
import { Suspense } from 'react'

import { useKeepMountedWhileOpen } from 'lib/hooks/useKeepMountedWhileOpen'
import { lazyWithRetry } from 'lib/utils/retryImport'

import { composeTicketLogic } from './composeTicketLogic'

// The modal anchors the support rich text editor (tiptap and prosemirror), so it loads only when it opens.
const ComposeTicketModal = lazyWithRetry(() =>
    import('./ComposeTicketModal').then((m) => ({ default: m.ComposeTicketModal }))
)

export function ComposeTicketModalHost(): JSX.Element | null {
    const { isOpen } = useValues(composeTicketLogic)
    const shouldRender = useKeepMountedWhileOpen(isOpen)
    return shouldRender ? (
        <Suspense fallback={null}>
            <ComposeTicketModal />
        </Suspense>
    ) : null
}