"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("./notice-bar-item.scss");
var _childrenNodeHandle = require("../../utils/children-node-handle");
var _timeUtil = require("../../utils/time-util");
var _excluded = ["content", "releaseTime", "isTop", "children"];
var NoticeBarItem = function NoticeBarItem(_ref) {
  var content = _ref.content,
    releaseTime = _ref.releaseTime,
    isTop = _ref.isTop,
    children = _ref.children,
    otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
  var _otherProps = otherProps || {};
  releaseTime = (0, _timeUtil.formatTime)(releaseTime);
  console.log((0, _childrenNodeHandle.convertChildren)(children, isTop === 1 ? 'teletext-tagc-1' : 'teletext-tagc-2', {
    name: isTop === 1 ? '置顶' : '最新'
  }));
  return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
    className: "notice-bar__panel__item"
  }, _otherProps), /*#__PURE__*/_react["default"].createElement("div", {
    className: "notice-bar__panel__item-left"
  }, (0, _childrenNodeHandle.convertChildren)(children, isTop === 1 ? 'teletext-tagc-1' : 'teletext-tagc-2', {
    name: isTop === 1 ? '置顶' : '最新'
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "notice-bar__panal__item__content"
  }, content)));
};
NoticeBarItem.displayName = 'NoticeBarItem';
var _default = exports["default"] = NoticeBarItem;