import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import * as React from 'react';
import { List } from '../components/rc-field-form';

var FormList = function FormList(_ref) {
  var customizePrefixCls = _ref.prefixCls,
      children = _ref.children,
      props = _objectWithoutProperties(_ref, ["prefixCls", "children"]);

  // const { getPrefixClassName } = React.useContext(ConfigContext);
  // const formPrefixCls = getPrefixClassName('form', customizePrefixCls);
  return /*#__PURE__*/React.createElement(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 _objectSpread(_objectSpread({}, field), {}, {
          fieldKey: field.key
        });
      }), operation, {
        errors: meta.errors
      })) // </FormItemPrefixContext.Provider>

    );
  });
};

export default FormList;