"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 IconArrowRight_1 = require("../../../icons/IconArrowRight/IconArrowRight");
var PropsWithAsAttributes_1 = require("../../../utils/types/PropsWithAsAttributes");
var Article_1 = require("../../Article/Article");
var Button_1 = require("../../Button/Button");
var EssenceCard_1 = require("../../EssenceCard/EssenceCard");
var usePropsHandler_1 = require("../../EventInterceptor/usePropsHandler");
var Grid_1 = require("../../Grid/Grid");
var ListLinks_1 = require("../../ListLinks/ListLinks");
var Slider_1 = require("../../Slider/Slider");
var Typography_1 = require("../../Typography");
var index_1 = require("./index");
exports.ContentBuilderTemplate = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    var _a, _b;
    var _c = (0, usePropsHandler_1.usePropsHandler)((0, index_1.cnContentBuilderTemplate)(), props), type = _c.type, title = _c.title, titleTag = _c.titleTag, text = _c.text, squads = _c.squads, items = _c.items, industry = _c.industry, industryColor = _c.industryColor, aliases = _c.aliases, services = _c.services, link = _c.link, linkColor = _c.linkColor;
    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'), as: titleTag }, 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: (_a = industryColor === null || industryColor === void 0 ? void 0 : industryColor.replace('#', '')) !== null && _a !== void 0 ? _a : linkColor === null || linkColor === void 0 ? void 0 : linkColor.replace('#', '') }))),
                link && (react_1["default"].createElement("div", { className: (0, index_1.cnContentBuilderTemplate)('Button') },
                    react_1["default"].createElement(Button_1.Button, { view: "link-primary", isLink: true, label: link.title, to: link.link, iconRight: IconArrowRight_1.IconArrowRight, decorBorder: (_b = industryColor === null || industryColor === void 0 ? void 0 : industryColor.replace('#', '')) !== null && _b !== void 0 ? _b : linkColor === null || linkColor === void 0 ? void 0 : linkColor.replace('#', '') }))))),
            (squads === null || squads === void 0 ? void 0 : squads.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: squads, getLabel: function (item) { return item.title; }, getPath: function (item) {
                        return (0, react_router_dom_1.generatePath)(aliases.INDUSTRIES_PAGE_INNER, {
                            slug: item.industrySlug,
                            inner_page: item.slug
                        });
                    } }))),
            (services === null || services === void 0 ? void 0 : services.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: services, getLabel: function (item) { return item.title; }, getPath: function (item) {
                        return (0, react_router_dom_1.generatePath)(aliases.SERVICES_PAGE, {
                            slug: item.slug
                        });
                    } }))),
            (items === null || items === void 0 ? void 0 : items.length) > 0 && (react_1["default"].createElement(Grid_1.GridItem, { breakpoints: {
                    desktop: { col: 3, colStart: 10 },
                    tablet: { col: 3, colStart: 6 },
                    mobile: { col: 2 }
                } },
                react_1["default"].createElement(Slider_1.Slider, { pagination: { clickable: true }, watchOverflow: true }, items.map(function (item) { return (react_1["default"].createElement(Slider_1.SliderItem, { key: item.id },
                    react_1["default"].createElement(EssenceCard_1.EssenceCard, (0, tslib_1.__assign)({}, item, { path: (0, react_router_dom_1.generatePath)(aliases.BLOG_SINGLE, {
                            slug: item.slug
                        }), descriptionSmall: item.detailLinkTitle, size: "s", detailLinkTitle: null })))); })))))));
});
exports["default"] = exports.ContentBuilderTemplate;
