import Iconfont from '../../../../../common/Iconfont';
import { ensure } from '../../../../../utils/commonUtil';
import ditoLogo from './imgs/dito-logo.svg';
import './index.less';

var React = require('react');

export default function index(props) {
  var _props$logo = props.logo,
      logo = _props$logo === void 0 ? {
    imgUrl: ditoLogo,
    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(ensure(function () {
        return logo.link;
      }, ''));
    }
  }), /*#__PURE__*/React.createElement("div", {
    className: "right"
  }, /*#__PURE__*/React.createElement(Iconfont, {
    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(ensure(function () {
        return messageLink;
      }, ''));
    }
  }, /*#__PURE__*/React.createElement(Iconfont, {
    type: "icon-message",
    size: 24,
    color: "#2C2C2C"
  }), !!messageNum && /*#__PURE__*/React.createElement("span", {
    className: "num"
  }, messageNum))));
}