import React__default from 'react';
import { inject, observer } from 'mobx-react';

function ReqAction({
  requestIds = [],
  req,
  children
}) {
  let isOk = false;
  if (!Array.isArray(requestIds) || requestIds.length === 0) {
    isOk = true;
  }
  const flags = new Array(requestIds.length).fill(false);
  requestIds.forEach((id, index) => {
    flags[index] = !req.reqStatusMap[id] ? true : req.reqStatusMap[id].status !== 'padding';
  });
  isOk = flags.filter(v => !v).length === 0;
  return React__default.Children.map(children, item => /*#__PURE__*/React__default.cloneElement(item, {
    reqIsOk: isOk
  }));
}
var index = inject('req')(observer(ReqAction));

export { index as default };
//# sourceMappingURL=index.js.map
