"use strict";
exports.__esModule = true;
exports.ContentBuilderTemplate = void 0;
var tslib_1 = require("tslib");
// @ts-nocheck
require("./ContentBuilderTemplate.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var PropsWithAsAttributes_1 = require("../../../utils/types/PropsWithAsAttributes");
var usePropsHandler_1 = require("../../EventInterceptor/usePropsHandler");
var index_1 = require("./index");
var Banner_1 = require("../../Banner/Banner");
var IconOpenInNew_1 = require("../../../icons/IconOpenInNew/IconOpenInNew");
exports.ContentBuilderTemplate = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    var _a = (0, usePropsHandler_1.usePropsHandler)((0, index_1.cnContentBuilderTemplate)(), props), type = _a.type, title = _a.title, text = _a.text, picture = _a.picture, linkTitle = _a.linkTitle, link = _a.link, targetBlank = _a.targetBlank, color = _a.color, isInverted = _a.isInverted;
    var typeNumber = type.toString();
    return (react_1["default"].createElement("div", { className: (0, index_1.cnContentBuilderTemplate)({ type: typeNumber }) },
        react_1["default"].createElement(Banner_1.Banner, { inverted: isInverted, bgColor: color, view: "section", title: title, titleSize: "md", text: text, picture: picture, labelButton: linkTitle, buttonIcon: IconOpenInNew_1.IconOpenInNew, buttonIconSize: "xs", onClick: function (e) {
                e.preventDefault();
                if (targetBlank) {
                    window.open(link, '_blank');
                }
                else {
                    window.location = link;
                }
            } })));
});
exports["default"] = exports.ContentBuilderTemplate;
