"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useCanvasContent = exports.CanvasContentProvider = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const React = tslib_1.__importStar(require("react"));
const CanvasContentContext = React.createContext(null);
const CanvasContentProvider = ({ content, setContent, templateContent, setTemplateContent, children, }) => {
    const value = React.useMemo(() => ({ content, setContent, templateContent, setTemplateContent }), [content, setContent, templateContent, setTemplateContent]);
    return (0, jsx_runtime_1.jsx)(CanvasContentContext.Provider, { value: value, children: children });
};
exports.CanvasContentProvider = CanvasContentProvider;
const useCanvasContent = () => {
    const context = React.useContext(CanvasContentContext);
    if (!context) {
        throw new Error('useCanvasContent must be used within a CanvasContentProvider');
    }
    return context;
};
exports.useCanvasContent = useCanvasContent;
//# sourceMappingURL=CanvasContentContext.js.map
