import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import React, { forwardRef } from 'react';
import { createBEM } from '@zarm-design/bem';
import { ConfigContext } from '../config-provider';
var NavBar = /*#__PURE__*/forwardRef(function (props, ref) {
  var className = props.className,
      title = props.title,
      left = props.left,
      right = props.right,
      restProps = _objectWithoutProperties(props, ["className", "title", "left", "right"]);

  var _React$useContext = React.useContext(ConfigContext),
      prefixCls = _React$useContext.prefixCls;

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