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.0 KB
Raw Blame
import { useActions, useValues } from 'kea'

import { WizardTrigger, alertWizardLogic } from '../alertWizardLogic'
import { WizardCard } from './WizardCard'

export function TriggerStep(): JSX.Element {
    const { availableTriggers } = useValues(alertWizardLogic)
    const { setTriggerKey } = useActions(alertWizardLogic)

    return (
        <div className="space-y-4">
            <div>
                <h2 className="text-xl font-semibold mb-1">What should trigger the alert?</h2>
                <p className="text-secondary text-sm">Choose when you want to be notified</p>
            </div>
            <div className="space-y-3">
                {availableTriggers.map((trigger: WizardTrigger) => (
                    <WizardCard
                        key={trigger.key}
                        name={trigger.name}
                        description={trigger.description}
                        onClick={() => setTriggerKey(trigger.key)}
                    />
                ))}
            </div>
        </div>
    )
}