"use strict";

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

var _react = _interopRequireDefault(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _precls = _interopRequireDefault(require("../precls"));

require("./index.css");

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

function _default(props) {
  var data = props.data,
      level = props.level;

  var onNodeClickHandler = function onNodeClickHandler() {
    if (data.href) {
      if (data.openBlank) {
        window.open(data.href, '_blank');
      } else {
        window.location.href = data.href;
      }
    }
  };

  return /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__menu-item-node")),
    onClick: onNodeClickHandler,
    title: ""
  }, level > 0 && /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__menu-item-node-indent"))
  }), data.icon && /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__menu-item-node-icon"), data.icon)
  }), /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__menu-item-node-title"), "noselect")
  }, props.title));
}