"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const cn_1 = require("../../utils/cn.js");
const constants_1 = require("../constants.js");
const b = (0, cn_1.formGeneratorCn)('fields');
const Fields = ({ fields, content, onUpdate, className }) => ((0, jsx_runtime_1.jsx)("div", { className: b(null, className), children: fields.map((field, index) => {
        const Component = constants_1.componentMap[field.type];
        if (!Component) {
            // eslint-disable-next-line
            console.warn(`NOT FOUND COMPONENT FOR TYPE ${field.type}`);
            return null;
        }
        return ((0, react_1.createElement)(Component, { ...field, className: b('field'), key: index, content: content, onUpdate: onUpdate }));
    }) }));
exports.default = Fields;
//# sourceMappingURL=Fields.js.map
