: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { useActions, useValues } from 'kea'
import { LemonModal } from '@posthog/lemon-ui'
import { LogsMetricRuleForm } from './LogsMetricRuleForm'
import { logsMetricRuleQuickCreateLogic } from './logsMetricRuleQuickCreateLogic'
/** The create-only modal launched from a log row in the viewer, prefilled from that log. */
export function LogsMetricRuleQuickCreateModal(): JSX.Element | null {
const { seed } = useValues(logsMetricRuleQuickCreateLogic)
const { closeQuickCreateModal } = useActions(logsMetricRuleQuickCreateLogic)
if (!seed) {
return null
}
return (
<LemonModal isOpen onClose={closeQuickCreateModal} title="New log-based metric" width={720} footer={null}>
<LogsMetricRuleForm rule={null} seed={seed} onCancel={closeQuickCreateModal} />
</LemonModal>
)
}