"use strict";
exports.__esModule = true;
exports.ContentBuilderItem = exports.cnContentBuilderItem = void 0;
var tslib_1 = require("tslib");
// @ts-nocheck
require("./ContentBuilderItem.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var bem_1 = require("../../utils/bem");
var PropsWithAsAttributes_1 = require("../../utils/types/PropsWithAsAttributes");
var BackgroundDecor_1 = require("../BackgroundDecor/BackgroundDecor");
var usePropsHandler_1 = require("../EventInterceptor/usePropsHandler");
var SiteBlock_1 = require("../SiteBlock/SiteBlock");
var templates_1 = (0, tslib_1.__importDefault)(require("./templates"));
exports.cnContentBuilderItem = (0, bem_1.cn)('ContentBuilderItem');
exports.ContentBuilderItem = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    var _a = (0, usePropsHandler_1.usePropsHandler)((0, exports.cnContentBuilderItem)(), props), type = _a.type, background = _a.background, _b = _a.topGap, topGap = _b === void 0 ? '6xl' : _b, _c = _a.bottomGap, bottomGap = _c === void 0 ? '5xl' : _c, hideContainer = _a.hideContainer, otherProps = (0, tslib_1.__rest)(_a, ["type", "background", "topGap", "bottomGap", "hideContainer"]);
    var TemplateTag = templates_1["default"][type];
    if (!TemplateTag)
        return false;
    return (react_1["default"].createElement(SiteBlock_1.SiteBlock, (0, tslib_1.__assign)({ topGap: topGap, bottomGap: bottomGap }, otherProps),
        background && react_1["default"].createElement(BackgroundDecor_1.BackgroundDecor, { view: background }),
        react_1["default"].createElement("div", { className: (!hideContainer && 'container') || 'container-fluid' },
            react_1["default"].createElement(TemplateTag, (0, tslib_1.__assign)({}, props)))));
});
