"use strict";
exports.__esModule = true;
exports.ContentBuilderTemplate0 = void 0;
var tslib_1 = require("tslib");
// @ts-nocheck
require("./ContentBuilderTemplate.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var PropsWithAsAttributes_1 = require("../../../utils/types/PropsWithAsAttributes");
var usePropsHandler_1 = require("../../EventInterceptor/usePropsHandler");
var index_1 = require("./index");
var Typography_1 = require("../../Typography");
var EssenceCard_1 = require("../../EssenceCard/EssenceCard");
var Button_1 = require("../../Button/Button");
var Slider_1 = require("../../Slider/Slider");
var IconArrowRight_1 = require("../../../icons/IconArrowRight/IconArrowRight");
exports.ContentBuilderTemplate0 = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    var _a = (0, usePropsHandler_1.usePropsHandler)((0, index_1.cnContentBuilderTemplate)(), props), type = _a.type, title = _a.title, videos = _a.videos, link = _a.link;
    var typeNumber = type.toString();
    var options = {
        watchOverflow: true,
        navigation: true,
        spaceBetween: 8,
        slidesPerView: 1,
        breakpoints: {
            767: {
                slidesPerView: 'auto',
                spaceBetween: 24
            },
            1199: {
                slidesPerView: 4
            }
        }
    };
    return (react_1["default"].createElement("div", { className: (0, index_1.cnContentBuilderTemplate)({ type: typeNumber }) },
        title && (react_1["default"].createElement(Typography_1.Typography.Text, { size: "xs", weight: "bold", transform: "uppercase", className: (0, index_1.cnContentBuilderTemplate)('Title') }, title)),
        (videos === null || videos === void 0 ? void 0 : videos.length) > 0 && (react_1["default"].createElement(Slider_1.Slider, (0, tslib_1.__assign)({}, options),
            videos.map(function (video) { return (react_1["default"].createElement(Slider_1.SliderItem, { key: video.videoUrl },
                react_1["default"].createElement(EssenceCard_1.EssenceCard, (0, tslib_1.__assign)({}, video, { tags: null, postDate: null })))); }),
            link && (react_1["default"].createElement(Slider_1.SliderItem, null,
                react_1["default"].createElement("a", { href: link.link, target: "_blank", className: (0, index_1.cnContentBuilderTemplate)('BlockCard'), rel: "noreferrer" },
                    react_1["default"].createElement(Button_1.Button, { view: "link-primary", inverted: true, label: link.title, size: "m", iconRight: IconArrowRight_1.IconArrowRight, as: "div", href: link.link, target: link.targetBlank ? '_blank' : null }))))))));
});
exports["default"] = exports.ContentBuilderTemplate0;
