"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactI18next = require("react-i18next");
var _UploadCellWrap = require("./UploadCellWrap");
var _upload = _interopRequireDefault(require("../../../styles/assets/icon/upload2.svg"));
var _loading_black = _interopRequireDefault(require("../../../styles/assets/icon/loading_black.svg"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const UploadCell = ({
  label,
  loading,
  width,
  height,
  showTip: _showTip = true,
  onClick
}) => {
  const {
    t
  } = (0, _reactI18next.useTranslation)();
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_UploadCellWrap.UploadCellWrap, {
    width: width,
    height: height,
    children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
      className: "label",
      children: t(label)
    }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: "uploadCellContainer",
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        onClick: () => {
          onClick === null || onClick === void 0 ? void 0 : onClick();
        },
        children: loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
          src: _loading_black.default
        }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
          src: _upload.default
        })
      }), _showTip && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        className: "tip",
        children: t('upload your file')
      })]
    })]
  });
};
var _default = UploadCell;
exports.default = _default;