// 导入前、文件上传中/校验中展示模块
import React, { memo } from 'react';
import { Button, Progress } from 'antd';
import { ExclamationCircleOutlined, CloudUploadOutlined, LoadingOutlined } from '@ant-design/icons';
import Upload from "../upload";
var Initial = function Initial(_ref) {
  var template = _ref.template,
    notice = _ref.notice,
    bucketName = _ref.bucketName,
    _ref$percent = _ref.percent,
    percent = _ref$percent === void 0 ? 0 : _ref$percent,
    status = _ref.status,
    onCancelUpload = _ref.onCancelUpload,
    onUpload = _ref.onUpload;
  return /*#__PURE__*/React.createElement("div", {
    className: "container-initial"
  }, template && /*#__PURE__*/React.createElement("div", {
    className: "template"
  }, template), notice && /*#__PURE__*/React.createElement("div", {
    className: "tips"
  }, /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null), /*#__PURE__*/React.createElement("span", null, notice)), /*#__PURE__*/React.createElement(Upload, {
    dragger: true,
    bucketName: bucketName,
    className: "upload-drag",
    validFileType: ['XLS', 'XLSX'],
    disabled: status === 'uploading',
    maxSize: 50 * 1024 * 1024,
    onChange: function onChange(fileList, file) {
      return onUpload(file);
    },
    showUploadList: false
  }, status === 'initial' ? /*#__PURE__*/React.createElement("div", {
    className: "wraps-initial"
  }, /*#__PURE__*/React.createElement("div", {
    className: "drag-icon"
  }, /*#__PURE__*/React.createElement(CloudUploadOutlined, null)), /*#__PURE__*/React.createElement("div", {
    className: "drag-text"
  }, "\u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904\u6216\u9009\u62E9\u6587\u4EF6\u4E0A\u4F20"), /*#__PURE__*/React.createElement("div", {
    className: "drag-hint"
  }, "\uFF08\u4EC5\u652F\u6301\uFF1AXLS\u3001XLSX\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC750MB\uFF09"), /*#__PURE__*/React.createElement(Button, {
    type: "primary"
  }, "\u70B9\u51FB\u4E0A\u4F20")) : /*#__PURE__*/React.createElement("div", {
    className: "wraps-uploading"
  }, /*#__PURE__*/React.createElement("div", {
    className: "progress"
  }, /*#__PURE__*/React.createElement(Progress, {
    percent: +percent.toFixed(0),
    status: "active"
  }), /*#__PURE__*/React.createElement("a", {
    className: "cancel",
    onClick: onCancelUpload
  }, "\u53D6\u6D88\u4E0A\u4F20")), /*#__PURE__*/React.createElement("div", {
    className: "progress-text"
  }, /*#__PURE__*/React.createElement(LoadingOutlined, null), " ", percent >= 30 ? '校验中...' : '上传中...'))));
};
export default /*#__PURE__*/memo(Initial);