'use strict';

var React = require('react');
var LocalizationContext = require('../../LocalizationContext-8cc9717d.js');
var ui_Label = require('../../index-35633fb6.js');
var ui_Icon = require('../../ui/Icon.js');
require('../../stringSet-ce782136.js');
require('../../index-d749c4c2.js');
require('prop-types');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

const UnreadCount = _ref => {
  var _time$toString, _time$toString$call;
  let {
    className = '',
    count = 0,
    time = '',
    onClick
  } = _ref;
  const {
    stringSet
  } = React.useContext(LocalizationContext.LocalizationContext);
  const timeArray = (time === null || time === void 0 ? void 0 : (_time$toString = time.toString) === null || _time$toString === void 0 ? void 0 : (_time$toString$call = _time$toString.call(time)) === null || _time$toString$call === void 0 ? void 0 : _time$toString$call.split(' ')) || [];
  timeArray === null || timeArray === void 0 ? void 0 : timeArray.splice(-2, 0, stringSet.CHANNEL__MESSAGE_LIST__NOTIFICATION__ON);
  return /*#__PURE__*/React__default["default"].createElement("div", {
    className: `sendbird-notification${count < 1 ? '--hide' : ''} ${className}`,
    onClick: onClick
  }, /*#__PURE__*/React__default["default"].createElement(ui_Label.Label, {
    className: "sendbird-notification__text",
    color: ui_Label.LabelColors.ONCONTENT_1,
    type: ui_Label.LabelTypography.CAPTION_2
  }, `${count} `, stringSet.CHANNEL__MESSAGE_LIST__NOTIFICATION__NEW_MESSAGE, ` ${timeArray.join(' ')}`), /*#__PURE__*/React__default["default"].createElement(ui_Icon["default"], {
    width: "24px",
    height: "24px",
    type: ui_Icon.IconTypes.CHEVRON_DOWN,
    fillColor: ui_Icon.IconColors.CONTENT
  }));
};

module.exports = UnreadCount;
//# sourceMappingURL=UnreadCount.js.map
