"use strict";

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

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

var _antd = require("antd");

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

require("./style");

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

var InfoCollection = function InfoCollection(props) {
  var data = props.data,
      _props$gap = props.gap,
      gap = _props$gap === void 0 ? 8 : _props$gap,
      _props$wrapStyle = props.wrapStyle,
      wrapStyle = _props$wrapStyle === void 0 ? {} : _props$wrapStyle;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "info-collection",
    style: wrapStyle
  }, data.map(function (item) {
    var style = {};
    if (item.color) style.color = item.color;
    return /*#__PURE__*/_react["default"].createElement("div", {
      className: "info-line",
      key: item.key,
      style: {
        marginBottom: gap
      }
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "label"
    }, item.label, "\uFF1A"), /*#__PURE__*/_react["default"].createElement("div", {
      className: "value",
      style: style
    }, item.type === 'img' ? item.value.map(function (e) {
      return /*#__PURE__*/_react["default"].createElement(_antd.Image, {
        style: {
          width: 50,
          height: 50
        },
        key: e.id,
        alt: e.name,
        src: "/cloudFile/common/downloadFile?id=".concat(e.id)
      });
    }) : item.value || '--'));
  }));
};

InfoCollection.propTypes = {
  data: _propTypes["default"].any,
  gap: _propTypes["default"].number,
  wrapStyle: _propTypes["default"].object
};
var _default = InfoCollection;
exports["default"] = _default;
//# sourceMappingURL=index.js.map
