"use strict";

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

var _fdx = require("@whalecloud/fdx");

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

var _folder = _interopRequireDefault(require("../../../../../../assets/imgs/folder.png"));

var _const = require("../const");

require("./index.less");

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

function CommonSelPicCard(_ref) {
  var content = _ref.content,
      _onChange = _ref.onChange,
      checked = _ref.checked,
      type = _ref.type,
      onClick = _ref.onClick;

  var handleClick = function handleClick() {
    if (content.contentType === 'Catg') {
      onClick(content.contentId);
    }
  };

  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "ant-upload-list ant-upload-list-picture-card"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "upload-list-item-container"
  }, /*#__PURE__*/_react["default"].createElement("span", null, content.contentType === 'Catg' ? /*#__PURE__*/_react["default"].createElement("div", {
    className: "upload-list-item folder",
    onClick: handleClick
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "item-body"
  }, /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement("div", {
    className: "ant-upload-list-item-thumbnail",
    href: ""
  }, /*#__PURE__*/_react["default"].createElement("img", {
    alt: "",
    style: {
      width: '100%',
      height: '100%'
    },
    src: _folder["default"]
  })))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "item-footer",
    title: content.contentTitle
  }, content.contentTitle)) : /*#__PURE__*/_react["default"].createElement("div", {
    className: "upload-list-item"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "item-body"
  }, /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement("div", {
    className: "ant-upload-list-item-thumbnail",
    href: ""
  }, /*#__PURE__*/_react["default"].createElement("img", {
    alt: "",
    style: {
      width: '100%',
      height: '100%'
    },
    src: type === _const.contentCatgTypeMap.PICTURE ? content.url : content.imgUrl
  }))), /*#__PURE__*/_react["default"].createElement("span", {
    style: {
      position: 'absolute',
      top: 4,
      right: 6
    }
  }, /*#__PURE__*/_react["default"].createElement(_fdx.Checkbox, {
    className: "checkbox",
    checked: checked,
    onChange: function onChange(e) {
      return _onChange(e, content);
    }
  }))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "item-footer",
    title: content.contentTitle
  }, content.contentTitle)))));
}

var _default = CommonSelPicCard;
exports["default"] = _default;