"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 react_router_dom_1 = require("react-router-dom");
var PropsWithAsAttributes_1 = require("../../../utils/types/PropsWithAsAttributes");
var usePropsHandler_1 = require("../../EventInterceptor/usePropsHandler");
var index_1 = require("./index");
var Typography_1 = require("../../Typography");
var Article_1 = require("../../Article/Article");
var Grid_1 = require("../../Grid/Grid");
var ListLinks_1 = require("../../ListLinks/ListLinks");
var Button_1 = require("../../Button/Button");
var IconArrowRight_1 = require("../../../icons/IconArrowRight/IconArrowRight");
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, industry = _a.industry, aliases = _a.aliases, columnI = _a.columnI, columnII = _a.columnII, industryColor = _a.industryColor;
    var typeNumber = type.toString();
    return (react_1["default"].createElement("div", { className: (0, index_1.cnContentBuilderTemplate)({ type: typeNumber }) },
        react_1["default"].createElement(Typography_1.Typography.Title, { size: "lg", className: (0, index_1.cnContentBuilderTemplate)('Title') }, title),
        react_1["default"].createElement(Grid_1.Grid, { breakpoints: {
                desktop: { cols: 12, gap: 'xl' },
                tablet: { cols: 8, rowGap: '3xl', colGap: 'm' },
                mobile: { cols: 2, gap: '3xl' }
            } },
            text && (react_1["default"].createElement(Grid_1.GridItem, { breakpoints: {
                    desktop: { col: 4 },
                    tablet: { col: 8 },
                    mobile: { col: 2 }
                }, className: (0, index_1.cnContentBuilderTemplate)('Column') },
                react_1["default"].createElement(Article_1.Article, { content: text }),
                industry && (react_1["default"].createElement("div", { className: (0, index_1.cnContentBuilderTemplate)('Button') },
                    react_1["default"].createElement(Button_1.Button, { view: "link-primary", isLink: true, label: industry.title, to: (0, react_router_dom_1.generatePath)(aliases.INDUSTRIES_PAGE, {
                            slug: industry.slug
                        }), iconRight: IconArrowRight_1.IconArrowRight, decorBorder: industryColor }))))),
            (columnI === null || columnI === void 0 ? void 0 : columnI.length) > 0 && (react_1["default"].createElement(Grid_1.GridItem, { breakpoints: {
                    desktop: { col: 4 },
                    tablet: { col: 4 },
                    mobile: { col: 2 }
                } },
                react_1["default"].createElement(ListLinks_1.ListLinks, { items: columnI, getLabel: function (item) { return item.title; }, getPath: function (item) {
                        return (0, react_router_dom_1.generatePath)(aliases.INDUSTRIES_PAGE_INNER, {
                            slug: industry.slug,
                            inner_page: item.slug
                        });
                    } }))),
            (columnII === null || columnII === void 0 ? void 0 : columnII.length) > 0 && (react_1["default"].createElement(Grid_1.GridItem, { breakpoints: {
                    desktop: { col: 4 },
                    tablet: { col: 4 },
                    mobile: { col: 2 }
                } },
                react_1["default"].createElement(ListLinks_1.ListLinks, { items: columnII, getLabel: function (item) { return item.title; }, getPath: function (item) {
                        return (0, react_router_dom_1.generatePath)(aliases.INDUSTRIES_PAGE_INNER, {
                            slug: industry.slug,
                            inner_page: item.slug
                        });
                    } }))))));
});
exports["default"] = exports.ContentBuilderTemplate;
