import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["content", "releaseTime", "isTop", "children"];
import React from 'react';
import "./notice-bar-item.scss";
import { convertChildren } from "../../utils/children-node-handle";
import { formatTime } from "../../utils/time-util";
var NoticeBarItem = function NoticeBarItem(_ref) {
  var content = _ref.content,
    releaseTime = _ref.releaseTime,
    isTop = _ref.isTop,
    children = _ref.children,
    otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
  var _otherProps = otherProps || {};
  releaseTime = formatTime(releaseTime);
  console.log(convertChildren(children, isTop === 1 ? 'teletext-tagc-1' : 'teletext-tagc-2', {
    name: isTop === 1 ? '置顶' : '最新'
  }));
  return /*#__PURE__*/React.createElement("div", _extends({
    className: "notice-bar__panel__item"
  }, _otherProps), /*#__PURE__*/React.createElement("div", {
    className: "notice-bar__panel__item-left"
  }, convertChildren(children, isTop === 1 ? 'teletext-tagc-1' : 'teletext-tagc-2', {
    name: isTop === 1 ? '置顶' : '最新'
  }), /*#__PURE__*/React.createElement("div", {
    className: "notice-bar__panal__item__content"
  }, content)));
};
NoticeBarItem.displayName = 'NoticeBarItem';
export default NoticeBarItem;