"use strict";
exports.__esModule = true;
exports.renderContentVacancy = exports.renderContentBanner = exports.renderContentPostsSecondary = exports.renderContentPartners = exports.renderContentClients = exports.renderContentListLinks = exports.renderContentSlider = exports.renderContentMembers = exports.renderContentPosts = void 0;
var tslib_1 = require("tslib");
// @ts-nocheck
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var ContentSlider_1 = require("../../ContentSlider/ContentSlider");
var MemberCard_1 = require("../../MemberCard/MemberCard");
var SiteBlock_1 = require("../../SiteBlock/SiteBlock");
var ListLinks_1 = require("../../ListLinks/ListLinks");
var Grid_1 = require("../../Grid/Grid");
var Typography_1 = require("../../Typography");
var Picture_1 = require("../../Picture/Picture");
var Banner_1 = require("../../Banner/Banner");
var EssenceCard_1 = require("../../EssenceCard/EssenceCard");
var VacancyCard_1 = require("../../VacancyCard/VacancyCard");
var IconOpenInNew_1 = require("../../../icons/IconOpenInNew/IconOpenInNew");
var react_router_1 = require("react-router");
var renderContentPosts = function (items, path) { return (react_1["default"].createElement(Grid_1.Grid, { breakpoints: {
        desktop: { cols: 1, gap: '3xl' },
        tablet: { cols: 2, colGap: 'm', rowGap: '4xl' },
        mobile: { cols: 1, gap: '4xl' }
    }, className: "Article-ContentPosts" }, items.map(function (post) { return (react_1["default"].createElement(Grid_1.GridItem, { col: "1", key: post.id + post.title },
    react_1["default"].createElement(EssenceCard_1.EssenceCard, (0, tslib_1.__assign)({}, post, { direction: "row", path: path(post) })))); }))); };
exports.renderContentPosts = renderContentPosts;
var renderContentMembers = function (_a) {
    var items = _a.items, path = _a.path, title = _a.title;
    if (items.length && path) {
        return (react_1["default"].createElement(SiteBlock_1.SiteBlock, { topGap: "xxl", bottomGap: "xxl", useMargin: true },
            title && (react_1["default"].createElement(SiteBlock_1.SiteBlock, { bottomGap: "xl", useMargin: true },
                react_1["default"].createElement(Typography_1.Typography.Text, { size: "xs", weight: "bold", transform: "uppercase" }, title))),
            react_1["default"].createElement(Grid_1.Grid, { breakpoints: {
                    desktop: { cols: 3, colGap: '2xl', rowGap: 'xl' },
                    tablet: { cols: 3, colGap: 'xs', rowGap: 'm' },
                    mobile: { cols: 1, gap: 'm' }
                }, className: "Article-ContentTeam" }, items.map(function (item) { return (react_1["default"].createElement(Grid_1.GridItem, { col: "1", key: item.id + item.title },
                react_1["default"].createElement(MemberCard_1.MemberCard, (0, tslib_1.__assign)({}, item, { routePath: path(item) })))); }))));
    }
};
exports.renderContentMembers = renderContentMembers;
var renderContentSlider = function (_a) {
    var items = _a.items, text = _a.text;
    if (items.length) {
        return (react_1["default"].createElement(SiteBlock_1.SiteBlock, { topGap: "3xl", bottomGap: "6xl", useMargin: true },
            react_1["default"].createElement(ContentSlider_1.ContentSlider, { items: items, text: text })));
    }
};
exports.renderContentSlider = renderContentSlider;
var renderContentListLinks = function (_a) {
    var items = _a.items, title = _a.title;
    if (items.length) {
        return (react_1["default"].createElement(SiteBlock_1.SiteBlock, { topGap: "xxl", bottomGap: "xxl", useMargin: true },
            title && (react_1["default"].createElement(SiteBlock_1.SiteBlock, { bottomGap: "m", useMargin: true },
                react_1["default"].createElement(Typography_1.Typography.Text, { size: "xs", weight: "bold", transform: "uppercase" }, title))),
            react_1["default"].createElement(ListLinks_1.ListLinks, { items: items, getLabel: function (item) { return item.title; }, getExternalLink: function (item) { return item.link; } })));
    }
};
exports.renderContentListLinks = renderContentListLinks;
var renderContentClients = function (_a) {
    var items = _a.items, path = _a.path, title = _a.title;
    if (items.length && path) {
        return (react_1["default"].createElement(SiteBlock_1.SiteBlock, { className: 'Article-ContentClients', useMargin: true },
            react_1["default"].createElement(Grid_1.Grid, { breakpoints: {
                    desktop: { cols: 12 },
                    tablet: { cols: 8 },
                    mobile: { cols: 2 }
                } }, items.map(function (partner, index) {
                return (react_1["default"].createElement(Grid_1.GridItem, { breakpoints: {
                        desktop: { col: 3 },
                        tablet: { col: 4 },
                        mobile: { col: 1 }
                    }, key: partner.id },
                    react_1["default"].createElement("a", { href: partner.link, target: "_blank", title: partner.title, rel: "noreferrer" }, partner.logo && react_1["default"].createElement(Picture_1.Picture, (0, tslib_1.__assign)({}, partner.logo)))));
            }))));
    }
};
exports.renderContentClients = renderContentClients;
var renderContentPartners = function (_a) {
    var items = _a.items;
    if (items.length) {
        return (react_1["default"].createElement(SiteBlock_1.SiteBlock, { className: 'Article-ContentPartners', useMargin: true, topGap: "3xl" },
            react_1["default"].createElement(Grid_1.Grid, { breakpoints: {
                    desktop: { cols: 12 },
                    tablet: { cols: 8 },
                    mobile: { cols: 2 }
                } }, items.map(function (partner, index) {
                return (react_1["default"].createElement(Grid_1.GridItem, { breakpoints: {
                        desktop: { col: 3 },
                        tablet: { col: 4 },
                        mobile: { col: 1 }
                    }, key: partner.id },
                    react_1["default"].createElement("a", { href: partner.link, target: "_blank", title: partner.title, rel: "noreferrer" },
                        partner.logo && react_1["default"].createElement(Picture_1.Picture, (0, tslib_1.__assign)({}, partner.logo)),
                        partner.picture && react_1["default"].createElement(Picture_1.Picture, (0, tslib_1.__assign)({}, partner.picture)))));
            }))));
    }
};
exports.renderContentPartners = renderContentPartners;
var renderContentPostsSecondary = function (_a) {
    var items = _a.items, path = _a.path;
    if (items.length && path) {
        return (react_1["default"].createElement(Grid_1.Grid, { breakpoints: {
                desktop: { cols: 1, gap: 'xl' },
                tablet: { cols: 2, colGap: 'm', rowGap: '4xl' },
                mobile: { cols: 1, gap: '4xl' }
            }, className: "Article-ContentPosts" }, items.map(function (post) { return (react_1["default"].createElement(Grid_1.GridItem, { col: "1", key: post.id + post.title },
            react_1["default"].createElement(EssenceCard_1.EssenceCard, (0, tslib_1.__assign)({}, post, { view: "filled", direction: "row", path: path(post) })))); })));
    }
};
exports.renderContentPostsSecondary = renderContentPostsSecondary;
var renderContentBanner = function (_a) {
    var title = _a.title, link = _a.link, linkTitle = _a.linkTitle, targetBlank = _a.targetBlank, picture = _a.picture;
    return (react_1["default"].createElement(Banner_1.Banner, { className: 'Article-Banner', view: "landing", inverted: true, title: title, picture: picture, buttonIcon: IconOpenInNew_1.IconOpenInNew, buttonIconSize: 'xs', labelButton: linkTitle, buttonAttrs: {
            as: 'a',
            href: link,
            target: targetBlank ? '_blank' : null
        } }));
};
exports.renderContentBanner = renderContentBanner;
var renderContentVacancy = function (_a) {
    var items = _a.items, title = _a.title, path = _a.path;
    if (items === null || items === void 0 ? void 0 : items.length) {
        return (react_1["default"].createElement(SiteBlock_1.SiteBlock, { className: 'Article-Vacancy', useMargin: true, topGap: "3xl", bottomGap: "xxl" },
            title && (react_1["default"].createElement(Typography_1.Typography.Text, { size: "xs", weight: "bold", transform: "uppercase", className: 'Article-Vacancy-Title' }, title)),
            react_1["default"].createElement(Grid_1.Grid, { cols: "1" }, items.map(function (item, index) {
                return (react_1["default"].createElement(Grid_1.GridItem, { key: item.id },
                    react_1["default"].createElement(VacancyCard_1.VacancyCard, (0, tslib_1.__assign)({}, item, { path: item.slug ? (0, react_router_1.generatePath)(path, { slug: item.slug }) : null }))));
            }))));
    }
};
exports.renderContentVacancy = renderContentVacancy;
