"use strict";

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

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

var _tooltip = _interopRequireDefault(require("../tooltip"));

var _util = require("../dialog-upload/util");

require("./index.css");

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

var DocType;
exports.DocType = DocType;

(function (DocType) {
  DocType["DOC"] = "doc";
  DocType["SLIDE"] = "slide";
  DocType["SHEET"] = "sheet";
  DocType["FORM"] = "form";
  DocType["PDF"] = "pdf";
  DocType["MIND"] = "mind";
  DocType["FLOWCHART"] = "flowchart";
  DocType["FOLDER"] = "folder";
})(DocType || (exports.DocType = DocType = {}));

var preCls = 'files-preview';

var FilePreview = function FilePreview(_ref) {
  var title = _ref.title,
      secondTitle = _ref.secondTitle,
      _ref$type = _ref.type,
      type = _ref$type === void 0 ? '' : _ref$type,
      _ref$className = _ref.className,
      className = _ref$className === void 0 ? '' : _ref$className,
      onClickTitle = _ref.onClickTitle;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, " ").concat(className)
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "__cover")
  }, /*#__PURE__*/_react["default"].createElement("img", {
    src: (0, _util.getFileTypeMapIcon)(type),
    className: "".concat(preCls, "__cover__img"),
    alt: ""
  })), /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "__content")
  }, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
    getTooltipContainer: function getTooltipContainer() {
      return document.body;
    },
    overlay: /*#__PURE__*/_react["default"].createElement("p", {
      dangerouslySetInnerHTML: {
        __html: title
      }
    })
  }, /*#__PURE__*/_react["default"].createElement("p", {
    onClick: onClickTitle,
    className: "".concat(preCls, "__title")
  }, title)), /*#__PURE__*/_react["default"].createElement("p", {
    className: "".concat(preCls, "__secondTitle")
  }, secondTitle)));
};

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