// @ts-nocheck
import './ContentBuilderTemplate.css';
import React from 'react';
import { forwardRefWithAs } from '../../../utils/types/PropsWithAsAttributes';
import { usePropsHandler } from '../../EventInterceptor/usePropsHandler';
import { cnContentBuilderTemplate } from './index';
import { Banner } from '../../Banner/Banner';
import { IconOpenInNew } from '../../../icons/IconOpenInNew/IconOpenInNew';
export var ContentBuilderTemplate = forwardRefWithAs(function (props, ref) {
    var _a = usePropsHandler(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.createElement("div", { className: cnContentBuilderTemplate({ type: typeNumber }) },
        React.createElement(Banner, { inverted: isInverted, bgColor: color, view: "section", title: title, titleSize: "md", text: text, picture: picture, labelButton: linkTitle, buttonIcon: IconOpenInNew, buttonIconSize: "xs", onClick: function (e) {
                e.preventDefault();
                if (targetBlank) {
                    window.open(link, '_blank');
                }
                else {
                    window.location = link;
                }
            } })));
});
export default ContentBuilderTemplate;
