function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import React, { useContext } from 'react';
import { ItemUI, Item } from "./export-item";
import { ConfigContext } from "../../config-provider/context";
import { replaceMessage } from "../../locale/utils";
import "./export-modal.less";
var ExportModalWrap = function ExportModalWrap(props) {
  return /*#__PURE__*/React.createElement(React.Fragment, null, props.list.map(function (item) {
    return /*#__PURE__*/React.createElement(Item, {
      key: item.taskId,
      fileName: item.fileName,
      status: item.status,
      taskId: item.taskId,
      callback: props.callback
    });
  }));
};
var ExportModalWrapUi = function ExportModalWrapUi(_ref) {
  var list = _ref.list;
  var componentContext = useContext(ConfigContext);
  var uiLocale = componentContext.uiLocale;
  return /*#__PURE__*/React.createElement("div", {
    className: "ehr-download-task-tooltip"
  }, /*#__PURE__*/React.createElement("div", {
    className: "title"
  }, replaceMessage(uiLocale.FileExport.progressCount, {
    count: "".concat(list === null || list === void 0 ? void 0 : list.length)
  })), /*#__PURE__*/React.createElement("div", {
    className: "ehr-download-task-tooltip-content"
  }, list.map(function (item) {
    return /*#__PURE__*/React.createElement(ItemUI, _extends({
      key: item.taskId
    }, item));
  })));
};
export { ExportModalWrapUi, ExportModalWrap };