import { __assign, __awaiter, __generator } from "tslib";
// @ts-nocheck
import './ContentBuilderTemplate.css';
import React from 'react';
import { forwardRefWithAs } from '../../../utils/types/PropsWithAsAttributes';
import { usePropsHandler } from '../../EventInterceptor/usePropsHandler';
import { cnContentBuilderTemplate } from './index';
import { Typography } from '../../Typography';
import { Grid, GridItem } from '../../Grid/Grid';
import { FileCard } from '../../FileCard/FileCard';
export var ContentBuilderTemplate = forwardRefWithAs(function (props, ref) {
    var _a = usePropsHandler(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.createElement("div", { className: cnContentBuilderTemplate({ type: typeNumber }) },
        React.createElement(Typography.Text, { size: "xs", weight: "bold", transform: "uppercase", className: cnContentBuilderTemplate('Title') }, title),
        React.createElement(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.createElement(GridItem, { key: item.id, col: "1" },
                React.createElement(FileCard, __assign({}, item, item.file, { extension: item.file.type, date: item.file.updatedAt, onSubmit: function (body) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
                        return [2 /*return*/, onSubmitFileForm(__assign(__assign({}, body), { filePath: item.file.url }))];
                    }); }); }, recaptchaKey: recaptchaKey })))); }),
            columnII.map(function (item) { return (React.createElement(GridItem, { key: item.id, col: "1" },
                React.createElement(FileCard, __assign({}, item, item.file, { date: item.file.updatedAt, extension: item.file.type, onSubmit: function (body) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
                        return [2 /*return*/, onSubmitFileForm(__assign(__assign({}, body), { filePath: item.file.url }))];
                    }); }); }, recaptchaKey: recaptchaKey })))); }))));
});
export default ContentBuilderTemplate;
