"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = index;

var _Iconfont = _interopRequireDefault(require("../../../../../common/Iconfont"));

var _commonUtil = require("../../../../../utils/commonUtil");

var _ditoLogo = _interopRequireDefault(require("./imgs/dito-logo.svg"));

require("./index.less");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var React = require('react');

function index(props) {
  var _props$logo = props.logo,
      logo = _props$logo === void 0 ? {
    imgUrl: _ditoLogo["default"],
    link: ''
  } : _props$logo,
      messageNum = props.messageNum,
      messageLink = props.messageLink,
      _onClick = props.onClick;
  return /*#__PURE__*/React.createElement("div", {
    className: "search-bar-wrap"
  }, /*#__PURE__*/React.createElement("img", {
    src: logo.imgUrl,
    alt: "",
    className: "logo",
    onClick: function onClick() {
      return _onClick((0, _commonUtil.ensure)(function () {
        return logo.link;
      }, ''));
    }
  }), /*#__PURE__*/React.createElement("div", {
    className: "right"
  }, /*#__PURE__*/React.createElement(_Iconfont["default"], {
    type: "icon-search2",
    size: 24,
    color: "#2C2C2C",
    onClick: function onClick() {
      return _onClick('/search-page');
    }
  }), /*#__PURE__*/React.createElement("div", {
    className: "message-wrap",
    onClick: function onClick() {
      return _onClick((0, _commonUtil.ensure)(function () {
        return messageLink;
      }, ''));
    }
  }, /*#__PURE__*/React.createElement(_Iconfont["default"], {
    type: "icon-message",
    size: 24,
    color: "#2C2C2C"
  }), !!messageNum && /*#__PURE__*/React.createElement("span", {
    className: "num"
  }, messageNum))));
}