import { __assign } from "tslib";
/* eslint-disable react/jsx-no-target-blank */
// @ts-nocheck
import React from 'react';
import { generatePath } from 'react-router';
import { IconOpenInNew } from '../../../icons/IconOpenInNew/IconOpenInNew';
import { Banner } from '../../Banner/Banner';
import { ContentSlider } from '../../ContentSlider/ContentSlider';
import { EssenceCard } from '../../EssenceCard/EssenceCard';
import { Grid, GridItem } from '../../Grid/Grid';
import { ListLinks } from '../../ListLinks/ListLinks';
import { MemberCard } from '../../MemberCard/MemberCard';
import { Picture } from '../../Picture/Picture';
import { SiteBlock } from '../../SiteBlock/SiteBlock';
import { Typography } from '../../Typography';
import { VacancyCard } from '../../VacancyCard/VacancyCard';
export var renderContentPosts = function (items, path) { return (React.createElement(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.createElement(GridItem, { col: "1", key: post.id + post.title },
    React.createElement(EssenceCard, __assign({}, post, { direction: "row", path: path(post) })))); }))); };
export var renderContentMembers = function (_a) {
    var items = _a.items, path = _a.path, title = _a.title;
    if (items.length && path) {
        return (React.createElement(SiteBlock, { topGap: "xxl", bottomGap: "xxl", useMargin: true },
            title && (React.createElement(SiteBlock, { bottomGap: "xl", useMargin: true },
                React.createElement(Typography.Text, { size: "xs", weight: "bold", transform: "uppercase" }, title))),
            React.createElement(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.createElement(GridItem, { col: "1", key: item.id + item.title },
                React.createElement(MemberCard, __assign({}, item, { routePath: path(item) })))); }))));
    }
};
export var renderContentSlider = function (_a) {
    var items = _a.items, text = _a.text;
    if (items.length) {
        return (React.createElement(SiteBlock, { topGap: "3xl", bottomGap: "6xl", useMargin: true },
            React.createElement(ContentSlider, { items: items, text: text })));
    }
};
export var renderContentListLinks = function (_a) {
    var items = _a.items, title = _a.title;
    if (items.length) {
        return (React.createElement(SiteBlock, { topGap: "xxl", bottomGap: "xxl", useMargin: true },
            title && (React.createElement(SiteBlock, { bottomGap: "m", useMargin: true },
                React.createElement(Typography.Text, { size: "xs", weight: "bold", transform: "uppercase" }, title))),
            React.createElement(ListLinks, { items: items, getLabel: function (item) { return item.title; }, getExternalLink: function (item) { return item.link; } })));
    }
};
export var renderContentClients = function (_a) {
    var items = _a.items, path = _a.path;
    if (items.length && path) {
        return (React.createElement(SiteBlock, { className: "Article-ContentClients", useMargin: true },
            React.createElement(Grid, { breakpoints: {
                    desktop: { cols: 12 },
                    tablet: { cols: 8 },
                    mobile: { cols: 2 }
                } }, items.map(function (partner) {
                return (React.createElement(GridItem, { breakpoints: {
                        desktop: { col: 3 },
                        tablet: { col: 4 },
                        mobile: { col: 1 }
                    }, key: partner.id },
                    React.createElement("a", { href: partner.link, target: "_blank", title: partner.title, rel: "noreferrer" }, partner.logo && React.createElement(Picture, __assign({}, partner.logo)))));
            }))));
    }
};
export var renderContentPartners = function (_a) {
    var items = _a.items;
    if (items.length) {
        return (React.createElement(SiteBlock, { className: "Article-ContentPartners", useMargin: true, topGap: "3xl" },
            React.createElement(Grid, { breakpoints: {
                    desktop: { cols: 12 },
                    tablet: { cols: 8 },
                    mobile: { cols: 2 }
                } }, items.map(function (partner) {
                return (React.createElement(GridItem, { breakpoints: {
                        desktop: { col: 3 },
                        tablet: { col: 4 },
                        mobile: { col: 1 }
                    }, key: partner.id },
                    React.createElement("a", { href: partner.link, target: "_blank", title: partner.title, rel: "noreferrer" },
                        partner.logo && React.createElement(Picture, __assign({}, partner.logo)),
                        partner.picture && React.createElement(Picture, __assign({}, partner.picture)))));
            }))));
    }
};
export var renderContentPostsSecondary = function (_a) {
    var items = _a.items, path = _a.path;
    if (items.length && path) {
        return (React.createElement(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.createElement(GridItem, { col: "1", key: post.id + post.title },
            React.createElement(EssenceCard, __assign({}, post, { view: "filled", direction: "row", path: path(post) })))); })));
    }
};
export var renderContentBanner = function (_a) {
    var title = _a.title, link = _a.link, linkTitle = _a.linkTitle, targetBlank = _a.targetBlank, picture = _a.picture;
    return (React.createElement(Banner, { className: "Article-Banner", view: "landing", inverted: true, title: title, picture: picture, buttonIcon: IconOpenInNew, buttonIconSize: "xs", labelButton: linkTitle, buttonAttrs: {
            as: 'a',
            href: link,
            target: targetBlank ? '_blank' : null
        } }));
};
export 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.createElement(SiteBlock, { className: "Article-Vacancy", useMargin: true, topGap: "3xl", bottomGap: "xxl" },
            title && (React.createElement(Typography.Text, { size: "xs", weight: "bold", transform: "uppercase", className: "Article-Vacancy-Title" }, title)),
            React.createElement(Grid, { cols: "1" }, items.map(function (item) {
                return (React.createElement(GridItem, { key: item.id },
                    React.createElement(VacancyCard, __assign({}, item, { path: item.slug ? generatePath(path, { slug: item.slug }) : null }))));
            }))));
    }
};
