"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = UploadButtonSkeleton;

var _react = _interopRequireDefault(require("react"));

var _Button = _interopRequireDefault(require("../button/Button"));

var _Box = _interopRequireDefault(require("../layout/Box"));

var _UploadButtonModule = _interopRequireDefault(require("./UploadButton.module.css"));

var _UploadButton = _interopRequireWildcard(require("./UploadButton.propTypes"));

var _getCompliedCustomId = _interopRequireDefault(require("../../utils/getCompliedCustomId"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function UploadButtonSkeleton(props) {
  var onChange = props.onChange,
      multiple = props.multiple,
      eleRef = props.eleRef,
      variant = props.variant,
      size = props.size,
      shape = props.shape,
      text = props.text,
      startIcon = props.startIcon,
      endIcon = props.endIcon,
      disabled = props.disabled,
      color = props.color,
      onClick = props.onClick,
      accept = props.accept,
      customId = props.customId;
  return /*#__PURE__*/_react["default"].createElement(_Box["default"], {
    className: _UploadButtonModule["default"].base,
    tagAttributeProps: {
      "data-id": (0, _getCompliedCustomId["default"])(props, customId.uploadButton)
    }
  }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    onClick: onClick,
    text: text,
    variant: variant,
    size: size,
    shape: shape,
    startIcon: startIcon,
    endIcon: endIcon,
    disabled: disabled,
    color: color
  }), /*#__PURE__*/_react["default"].createElement("input", {
    type: "file",
    className: _UploadButtonModule["default"].uploadLink,
    ref: eleRef,
    onChange: onChange,
    multiple: multiple,
    accept: accept
  }));
}

UploadButtonSkeleton.propTypes = _UploadButton["default"];
UploadButtonSkeleton.defaultProps = _UploadButton.defaultProps;
UploadButtonSkeleton.propsDescription = _UploadButton.propsDescription;