import { __assign } from "tslib";
// @ts-nocheck
import './ContentBuilderTemplate.css';
import React from 'react';
import { generatePath } from 'react-router-dom';
import { forwardRefWithAs } from '../../../utils/types/PropsWithAsAttributes';
import { usePropsHandler } from '../../EventInterceptor/usePropsHandler';
import { cnContentBuilderTemplate } from './index';
import { Typography } from '../../Typography/Typography';
import { Article } from '../../Article/Article';
import { Slider, SliderItem } from '../../Slider/Slider';
import { EssenceCard } from '../../EssenceCard/EssenceCard';
export var ContentBuilderTemplate = forwardRefWithAs(function (props, ref) {
    var _a = usePropsHandler(cnContentBuilderTemplate(), props), type = _a.type, title = _a.title, text = _a.text, items = _a.items, aliases = _a.aliases;
    var typeNumber = type.toString();
    var options = {
        navigation: true,
        breakpoints: {
            767: {
                spaceBetween: 16,
                slidesPerView: 2
            },
            1200: {
                spaceBetween: 24,
                slidesPerView: 3
            }
        },
        spaceBetween: 8,
        slidesPerView: 1,
        watchOverflow: true
    };
    return (React.createElement("div", { className: cnContentBuilderTemplate({ type: typeNumber }) },
        title && (React.createElement(Typography.Text, { size: "xs", weight: "bold", transform: "uppercase", className: cnContentBuilderTemplate('Title'), as: "h4" }, title)),
        text && (React.createElement(Article, { content: text, className: cnContentBuilderTemplate('SubTitle') })),
        React.createElement(Slider, __assign({}, options), items.map(function (post) { return (React.createElement(SliderItem, { key: post.slug },
            React.createElement(EssenceCard, __assign({}, post, { routePath: generatePath(aliases.EVENTS_PAGE, {
                    slug: post.slug
                }), path: generatePath(aliases.BLOG_SINGLE, {
                    slug: post.slug
                }), view: "filled", size: "m", linkTitle: post.contentType === 0
                    ? 'read more'
                    : post.contentType === 2
                        ? 'watch on youtube'
                        : null })))); }))));
});
export default ContentBuilderTemplate;
