"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _classnames = _interopRequireDefault(require("classnames"));
var _antd = require("antd");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var prefixCls = 'ol-map-analysis-result-item';
var ResultItem = function ResultItem(_ref) {
  var info = _ref.info,
    _ref$titleKey = _ref.titleKey,
    titleKey = _ref$titleKey === void 0 ? 'name' : _ref$titleKey,
    getOtherContent = _ref.getOtherContent,
    onTitleClick = _ref.onTitleClick,
    onItemClick = _ref.onItemClick,
    getDetailContent = _ref.getDetailContent,
    getOtherTitle = _ref.getOtherTitle,
    showBorder = _ref.showBorder;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(prefixCls, "-wrap"), {
      border: showBorder
    }),
    onClick: function onClick() {
      return onItemClick(info);
    }
  }, /*#__PURE__*/_react["default"].createElement(_antd.Space, null, /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefixCls, "-title"),
    onClick: function onClick(e) {
      e.stopPropagation();
      onTitleClick(info);
    }
  }, info[titleKey]), getOtherTitle ? getOtherTitle(info) : null), getOtherContent ? getOtherContent(info) : null, getDetailContent ? getDetailContent(info) : null);
};
ResultItem.propTypes = {
  info: _propTypes["default"].object,
  showBorder: _propTypes["default"].bool,
  titleKey: _propTypes["default"].string,
  getDetailContent: _propTypes["default"].func,
  getOtherContent: _propTypes["default"].func,
  onTitleClick: _propTypes["default"].func,
  onItemClick: _propTypes["default"].func,
  getOtherTitle: _propTypes["default"].func
};
var _default = exports["default"] = ResultItem;
//# sourceMappingURL=ResultItem.js.map
