"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _DownloadWrap = require("./DownloadWrap");
var _constants = require("../..\\utils\\constants");
var _getPlatform = require("../..\\utils\\getPlatform");
var _Button = _interopRequireDefault(require("../Button"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const Download = ({
  media,
  mediaVisible,
  mediaMimeType,
  cardWidth
}) => {
  var _mediaMimeType$split$;
  const url = (0, _getPlatform.getPlatformType)(media) === 'IPFS' ? (0, _constants.revokeJsonProxy)(media) : media;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DownloadWrap.DownloadWrap, {
    mediaVisible: mediaVisible,
    cardWidth: cardWidth,
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: "hideScrollbar",
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        className: "spanContainer",
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
          children: mediaMimeType === null || mediaMimeType === void 0 ? void 0 : (_mediaMimeType$split$ = mediaMimeType.split('/')[1]) === null || _mediaMimeType$split$ === void 0 ? void 0 : _mediaMimeType$split$.split(';')[0]
        })
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
        target: "_blank",
        rel: "noreferrer noopener",
        download: true,
        href: url,
        className: "downloadA",
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
          label: "Download File"
        })
      })]
    })
  });
};
var _default = Download;
exports.default = _default;