"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generalExtension = exports.GeneralExtensionContentWrapper = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const BrandFooter_1 = tslib_1.__importDefault(require("../../components/BrandFooter/BrandFooter.js"));
const utils_1 = require("../../utils/index.js");
const GravityBlocksProvider_1 = require("../context/GravityBlocksProvider.js");
const hooks_1 = require("../hooks/index.js");
const b = (0, utils_1.block)('page-constructor');
const GeneralExtensionContentWrapper = (props) => {
    const { children, isBranded: isBrandedProp, ...rest } = props;
    const { content } = (0, hooks_1.useContent)();
    const { isBranded = isBrandedProp, animated = rest.animated } = content;
    return ((0, jsx_runtime_1.jsx)("div", { className: b('wrapper'), children: (0, jsx_runtime_1.jsxs)(GravityBlocksProvider_1.GravityBlocksProvider, { animated: animated, ...rest, children: [children, isBranded && (0, jsx_runtime_1.jsx)(BrandFooter_1.default, {})] }) }));
};
exports.GeneralExtensionContentWrapper = GeneralExtensionContentWrapper;
const generalExtension = ({ wrapperProps = {}, globalDefaults = {}, }) => {
    return {
        name: 'General Extension',
        id: '@gravity-ui/page-constructor/general-extension',
        settings: {
            ContentWrapper: exports.GeneralExtensionContentWrapper,
            contentWrapperProps: wrapperProps,
            globalInputs: [
                {
                    type: 'switch',
                    title: 'Is branded',
                    name: 'isBranded',
                },
                {
                    type: 'switch',
                    title: 'Animated',
                    name: 'animated',
                },
            ],
            globalDefaults,
        },
    };
};
exports.generalExtension = generalExtension;
//# sourceMappingURL=GeneralExtension.js.map
