import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["onClick", "title", "image", "gmtCreate", "children", "description", "isRead"];
import React from 'react';
import "./message-list-item.scss";
import { convertChildren } from "../../utils/children-node-handle";

/**
 * 数据
 */

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 = _objectWithoutPropertiesLoose(_ref, _excluded);
  var _otherProps = otherProps || {};
  return /*#__PURE__*/React.createElement("div", _extends({
    className: "message-list__panel__item",
    onClick: onClick
  }, _otherProps), convertChildren(children, 'image', {
    src: image
  }), isRead ? null : /*#__PURE__*/React.createElement("span", {
    className: "badge"
  }), /*#__PURE__*/React.createElement("div", {
    className: "message-list__panel__item__text"
  }, convertChildren(children, 'title', {
    children: [title]
  }), convertChildren(children, 'gmtCreate', {
    children: [gmtCreate]
  }), convertChildren(children, 'content', {
    children: [description]
  })));
};
MessageListItem.displayName = 'TeletextListItem';
export default MessageListItem;