"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 PropsWithAsAttributes_1 = require("../../../utils/types/PropsWithAsAttributes");
var usePropsHandler_1 = require("../../EventInterceptor/usePropsHandler");
var index_1 = require("./index");
var Typography_1 = require("../../Typography");
var Grid_1 = require("../../Grid/Grid");
var FileCard_1 = require("../../FileCard/FileCard");
exports.ContentBuilderTemplate = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    var _a = (0, usePropsHandler_1.usePropsHandler)((0, index_1.cnContentBuilderTemplate)(), props), title = _a.title, columnI = _a.columnI, columnII = _a.columnII, type = _a.type, onSubmitFileForm = _a.onSubmitFileForm, recaptchaKey = _a.recaptchaKey;
    var typeNumber = type.toString();
    return (react_1["default"].createElement("div", { className: (0, index_1.cnContentBuilderTemplate)({ type: typeNumber }) },
        react_1["default"].createElement(Typography_1.Typography.Text, { size: "xs", weight: "bold", transform: "uppercase", className: (0, index_1.cnContentBuilderTemplate)('Title') }, title),
        react_1["default"].createElement(Grid_1.Grid, { breakpoints: {
                desktop: { cols: 2, colGap: 'xl', rowGap: 's' },
                tablet: { cols: 2, rowGap: '3xl', colGap: 'm' },
                mobile: { cols: 2, gap: '3xl' }
            } },
            columnI.map(function (item) { return (react_1["default"].createElement(Grid_1.GridItem, { key: item.id, col: "1" },
                react_1["default"].createElement(FileCard_1.FileCard, (0, tslib_1.__assign)({}, item, item.file, { extension: item.file.type, date: item.file.updatedAt, onSubmit: function (body) { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () { return (0, tslib_1.__generator)(this, function (_a) {
                        return [2 /*return*/, onSubmitFileForm((0, tslib_1.__assign)((0, tslib_1.__assign)({}, body), { filePath: item.file.url }))];
                    }); }); }, recaptchaKey: recaptchaKey })))); }),
            columnII.map(function (item) { return (react_1["default"].createElement(Grid_1.GridItem, { key: item.id, col: "1" },
                react_1["default"].createElement(FileCard_1.FileCard, (0, tslib_1.__assign)({}, item, item.file, { date: item.file.updatedAt, extension: item.file.type, onSubmit: function (body) { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () { return (0, tslib_1.__generator)(this, function (_a) {
                        return [2 /*return*/, onSubmitFileForm((0, tslib_1.__assign)((0, tslib_1.__assign)({}, body), { filePath: item.file.url }))];
                    }); }); }, recaptchaKey: recaptchaKey })))); }))));
});
exports["default"] = exports.ContentBuilderTemplate;
