import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2026 GoodData Corporation
import { createContext, useContext, useState } from "react";
const ExportTemplateDialogContext = createContext({
    isOpen: false,
    dialogConfig: undefined,
    closeDialog: () => { },
    openDialog: () => { },
});
/**
 * @internal
 */
export const useExportTemplateDialogContext = () => {
    return useContext(ExportTemplateDialogContext);
};
/**
 * @internal
 */
export function ExportTemplateDialogContextProvider({ children }) {
    const [dialogConfig, setDialogConfig] = useState(undefined);
    const openDialog = (config) => {
        setDialogConfig(config);
    };
    const closeDialog = () => {
        setDialogConfig(undefined);
    };
    return (_jsx(ExportTemplateDialogContext.Provider, { value: { isOpen: dialogConfig !== undefined, dialogConfig, openDialog, closeDialog }, children: children }));
}
