"use strict";

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

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

var _reactPhotoView = require("react-photo-view");

require("react-photo-view/dist/react-photo-view.css");

var _antd = require("antd");

var _propTypes = _interopRequireDefault(require("prop-types"));

var _api = require("./api");

var _vmInfoCollection = _interopRequireDefault(require("../vm-info-collection"));

require("./style");

var _default2 = _interopRequireDefault(require("../../image/default.png"));

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

var BaseContent = function BaseContent(props) {
  var id = props.id,
      setCode = props.setCode;

  var _BaseData$useBaseInfo = _api.BaseData.useBaseInfo(id, setCode),
      info = _BaseData$useBaseInfo.info,
      photos = _BaseData$useBaseInfo.photos;

  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "muck-base-content",
    style: {
      width: '100%',
      height: '100%'
    }
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "left"
  }, (photos === null || photos === void 0 ? void 0 : photos.length) > 0 ? /*#__PURE__*/_react["default"].createElement(_antd.Carousel, {
    autoplay: true
  }, photos.map(function (item) {
    return /*#__PURE__*/_react["default"].createElement(_reactPhotoView.PhotoProvider, {
      key: item.id
    }, /*#__PURE__*/_react["default"].createElement(_reactPhotoView.PhotoView, {
      src: "/cloudFile/common/downloadFile?id=".concat(item.id)
    }, /*#__PURE__*/_react["default"].createElement("img", {
      style: {
        width: '100%',
        height: 'auto'
      },
      alt: item.name,
      src: "/cloudFile/common/downloadFile?id=".concat(item.id)
    })));
  })) : /*#__PURE__*/_react["default"].createElement("img", {
    src: _default2["default"],
    style: {
      width: '100%',
      margin: '100px auto',
      opacity: 0.5
    }
  })), /*#__PURE__*/_react["default"].createElement("div", {
    className: "right"
  }, /*#__PURE__*/_react["default"].createElement("h3", null, "\u57FA\u672C\u4FE1\u606F"), /*#__PURE__*/_react["default"].createElement(_vmInfoCollection["default"], {
    data: info
  })));
};

BaseContent.propTypes = {
  id: _propTypes["default"].string,
  setCode: _propTypes["default"].func
};
var _default = BaseContent;
exports["default"] = _default;
//# sourceMappingURL=base.js.map
