import { __assign, __rest } from "tslib";
// @ts-nocheck
import './ContentBuilderItem.css';
import React from 'react';
import { cn } from '../../utils/bem';
import { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';
import { BackgroundDecor } from '../BackgroundDecor/BackgroundDecor';
import { usePropsHandler } from '../EventInterceptor/usePropsHandler';
import { SiteBlock } from '../SiteBlock/SiteBlock';
import Components from './templates';
export var cnContentBuilderItem = cn('ContentBuilderItem');
export var ContentBuilderItem = forwardRefWithAs(function (props, ref) {
    var _a = usePropsHandler(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 = __rest(_a, ["type", "background", "topGap", "bottomGap", "hideContainer"]);
    var TemplateTag = Components[type];
    if (!TemplateTag)
        return false;
    return (React.createElement(SiteBlock, __assign({ topGap: topGap, bottomGap: bottomGap }, otherProps),
        background && React.createElement(BackgroundDecor, { view: background }),
        React.createElement("div", { className: (!hideContainer && 'container') || 'container-fluid' },
            React.createElement(TemplateTag, __assign({}, props)))));
});
