// (C) 2026 GoodData Corporation
import { createContext, useContext } from "react";
const AutomationsContext = createContext(undefined);
export const AutomationsContextProvider = AutomationsContext.Provider;
export function useAutomationsContext() {
    const ctx = useContext(AutomationsContext);
    if (!ctx) {
        throw new Error("useAutomationsContext must be used within an AutomationsContextProvider. " +
            "The automation dialogs (e.g. DefaultAlertingDialog) are pure context consumers; " +
            "render them inside a Dashboard — which supplies the provider via the alerting " +
            "connector — or wrap them in AutomationsContextProvider yourself.");
    }
    return ctx;
}
