import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2019-2025 GoodData Corporation
import { createContext, useContext } from "react";
import { UnexpectedSdkError } from "@gooddata/sdk-ui";
import { useNotifications } from "./useNotifications.js";
const NotificationsContext = createContext(null);
NotificationsContext.displayName = "NotificationsContext";
/**
 * @internal
 */
export const useNotificationsContext = () => {
    const context = useContext(NotificationsContext);
    if (!context) {
        throw new UnexpectedSdkError("useNotificationsContext must be used within a NotificationsProvider");
    }
    return context;
};
/**
 * @internal
 */
export function NotificationsProvider({ children, backend, workspace, refreshInterval, itemsPerPage, enableScheduleNotifications, }) {
    const notifications = useNotifications({
        backend,
        workspace,
        refreshInterval,
        itemsPerPage,
        enableScheduleNotifications,
    });
    return _jsx(NotificationsContext.Provider, { value: notifications, children: children });
}
//# sourceMappingURL=NotificationsContext.js.map