// 导入失败模块
import React, { useContext } from 'react';
import { Divider } from 'antd';
import { CloseCircleFilled } from '@ant-design/icons';
import { ConfigContext } from "../config-provider/context";
var Error = function Error(_ref) {
  var errorTip = _ref.errorTip,
    errorFileUrl = _ref.errorFileUrl,
    onReImport = _ref.onReImport;
  var componentContext = useContext(ConfigContext);
  var uiLocale = componentContext.uiLocale;
  var defaultTip = errorFileUrl ? uiLocale.FileImport.Error.errorFileUrl : uiLocale.FileImport.Error.commonError;
  return /*#__PURE__*/React.createElement("div", {
    className: "container-error"
  }, /*#__PURE__*/React.createElement(CloseCircleFilled, null), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
    className: "title"
  }, uiLocale.FileImport.Error.title), /*#__PURE__*/React.createElement("div", {
    className: "desc"
  }, (typeof errorTip === 'function' ? errorTip(errorFileUrl) : errorTip) || defaultTip), /*#__PURE__*/React.createElement("div", null, errorFileUrl && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("a", {
    href: errorFileUrl
  }, uiLocale.FileImport.Error.download), /*#__PURE__*/React.createElement(Divider, {
    type: "vertical"
  })), /*#__PURE__*/React.createElement("a", {
    onClick: onReImport
  }, uiLocale.FileImport.repeatBtnText))));
};
export default Error;