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, { useEffect } from 'react';
import { Upload, Button } from 'antd';
import { InboxOutlined, UploadOutlined } from '@ant-design/icons';
import classNames from 'classnames';
var Dragger = Upload.Dragger;
import "./index.less";
var PisellUpload = function PisellUpload(props) {
  var title = props.title,
    text1 = props.text1,
    text2 = props.text2,
    uploadType = props.uploadType;
  useEffect(function () {
    document.body.id = 'body';
  }, []);
  if (uploadType === 'custom') {
    return /*#__PURE__*/React.createElement(Upload, props, props.children);
  }
  return /*#__PURE__*/React.createElement("div", null, uploadType === 'button' ? /*#__PURE__*/React.createElement(Upload, props, /*#__PURE__*/React.createElement(Button, {
    icon: /*#__PURE__*/React.createElement(UploadOutlined, null)
  }, "Upload")) : /*#__PURE__*/React.createElement(Dragger, _extends({}, props, {
    className: classNames('pisell-upload-wapper')
  }), /*#__PURE__*/React.createElement("p", {
    className: "ant-upload-drag-icon"
  }, /*#__PURE__*/React.createElement(InboxOutlined, null)), /*#__PURE__*/React.createElement("p", {
    className: "ant-upload-title"
  }, title), /*#__PURE__*/React.createElement("p", {
    className: "ant-upload-text1"
  }, text1), /*#__PURE__*/React.createElement("p", {
    className: "ant-upload-text2"
  }, text2)));
};
export default PisellUpload;