"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

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

var _bem = require("@zarm-design/bem");

var _configProvider = require("../config-provider");

var NavBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
  var className = props.className,
      title = props.title,
      left = props.left,
      right = props.right,
      restProps = (0, _objectWithoutProperties2.default)(props, ["className", "title", "left", "right"]);

  var _React$useContext = _react.default.useContext(_configProvider.ConfigContext),
      prefixCls = _React$useContext.prefixCls;

  var bem = (0, _bem.createBEM)('nav-bar', {
    prefixCls: prefixCls
  });
  return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
    ref: ref,
    className: bem([className])
  }, restProps), left && /*#__PURE__*/_react.default.createElement("div", {
    className: bem('side', [{
      left: true
    }])
  }, left), title && /*#__PURE__*/_react.default.createElement("div", {
    className: bem('title')
  }, title), right && /*#__PURE__*/_react.default.createElement("div", {
    className: bem('side', [{
      right: true
    }])
  }, right));
});
NavBar.displayName = 'NavBar';
NavBar.defaultProps = {};
var _default = NavBar;
exports.default = _default;