"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"));

var _bsGlobal = require("../../../../../utils/bs-global");

require("./index.css");

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

var i18nInfo = (0, _bsGlobal.getBSGlobal)("I18NInfo");
var isZn = !i18nInfo || i18nInfo && i18nInfo.I18NOpen && i18nInfo.I18NUserLang === "zh_CN";

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

  var onNodeClickHandler = function onNodeClickHandler() {
    if (data.href) {
      window.location.href = data.href;
    }
  };

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