"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var React = _interopRequireWildcard(require("react"));

var _rcFieldForm = require("../components/rc-field-form");

var FormList = function FormList(_ref) {
  var customizePrefixCls = _ref.prefixCls,
      children = _ref.children,
      props = (0, _objectWithoutProperties2.default)(_ref, ["prefixCls", "children"]);
  // const { getPrefixClassName } = React.useContext(ConfigContext);
  // const formPrefixCls = getPrefixClassName('form', customizePrefixCls);
  return /*#__PURE__*/React.createElement(_rcFieldForm.List, Object.assign({}, props), function (fields, operation, meta) {
    return (
      /*#__PURE__*/
      // <FormItemPrefixContext.Provider value={{ prefixCls, status: 'error' }}>
      React.createElement(React.Fragment, null, children(fields.map(function (field) {
        return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, field), {}, {
          fieldKey: field.key
        });
      }), operation, {
        errors: meta.errors
      })) // </FormItemPrefixContext.Provider>

    );
  });
};

var _default = FormList;
exports.default = _default;