"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _react = _interopRequireDefault(require("react"));
require("./message-list-item.scss");
var _childrenNodeHandle = require("../../utils/children-node-handle");
var _excluded = ["onClick", "title", "image", "gmtCreate", "children", "description", "isRead"];
/**
 * 数据
 */

var MessageListItem = function MessageListItem(_ref) {
  var _ref$onClick = _ref.onClick,
    onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
    title = _ref.title,
    image = _ref.image,
    gmtCreate = _ref.gmtCreate,
    children = _ref.children,
    description = _ref.description,
    isRead = _ref.isRead,
    otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
  var _otherProps = otherProps || {};
  return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
    className: "message-list__panel__item",
    onClick: onClick
  }, _otherProps), (0, _childrenNodeHandle.convertChildren)(children, 'image', {
    src: image
  }), isRead ? null : /*#__PURE__*/_react["default"].createElement("span", {
    className: "badge"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "message-list__panel__item__text"
  }, (0, _childrenNodeHandle.convertChildren)(children, 'title', {
    children: [title]
  }), (0, _childrenNodeHandle.convertChildren)(children, 'gmtCreate', {
    children: [gmtCreate]
  }), (0, _childrenNodeHandle.convertChildren)(children, 'content', {
    children: [description]
  })));
};
MessageListItem.displayName = 'TeletextListItem';
var _default = exports["default"] = MessageListItem;