import { useTranslation } from 'react-i18next';
import { UploadCellWrap } from "./UploadCellWrap";
import uploadSvg from "../../../styles/assets/icon/upload2.svg";
import loadingSvg from "../../../styles/assets/icon/loading_black.svg";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
var UploadCell = function UploadCell(_ref) {
  var label = _ref.label,
    loading = _ref.loading,
    width = _ref.width,
    height = _ref.height,
    _ref$showTip = _ref.showTip,
    showTip = _ref$showTip === void 0 ? true : _ref$showTip,
    _onClick = _ref.onClick;
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  return /*#__PURE__*/_jsxs(UploadCellWrap, {
    width: width,
    height: height,
    children: [label && /*#__PURE__*/_jsx("div", {
      className: "label",
      children: t(label)
    }), /*#__PURE__*/_jsxs("div", {
      className: "uploadCellContainer",
      children: [/*#__PURE__*/_jsx("div", {
        onClick: function onClick() {
          _onClick === null || _onClick === void 0 ? void 0 : _onClick();
        },
        children: loading ? /*#__PURE__*/_jsx("img", {
          src: loadingSvg
        }) : /*#__PURE__*/_jsx("img", {
          src: uploadSvg
        })
      }), showTip && /*#__PURE__*/_jsx("div", {
        className: "tip",
        children: t('upload your file')
      })]
    })]
  });
};
export default UploadCell;