'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _reactIntl = require('react-intl');

var _immutable = require('immutable');

var _immutable2 = _interopRequireDefault(_immutable);

var _QuickSearchFormContainer = require('../../containers/search/QuickSearchFormContainer');

var _QuickSearchFormContainer2 = _interopRequireDefault(_QuickSearchFormContainer);

var _NavBar = require('../navigation/NavBar');

var _NavBar2 = _interopRequireDefault(_NavBar);

var _UserMenu = require('../user/UserMenu');

var _UserMenu2 = _interopRequireDefault(_UserMenu);

var _Logo = require('./Logo');

var _Logo2 = _interopRequireDefault(_Logo);

var _withConfig = require('../../enhancers/withConfig');

var _withConfig2 = _interopRequireDefault(_withConfig);

var _Banner = require('../../../styles/cspace-ui/Banner.css');

var _Banner2 = _interopRequireDefault(_Banner);

var _BannerMain = require('../../../styles/cspace-ui/BannerMain.css');

var _BannerMain2 = _interopRequireDefault(_BannerMain);

var _BannerRight = require('../../../styles/cspace-ui/BannerRight.css');

var _BannerRight2 = _interopRequireDefault(_BannerRight);

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

var propTypes = {
  screenName: _propTypes2.default.string.isRequired,
  history: _propTypes2.default.object,
  intl: _reactIntl.intlShape,
  config: _propTypes2.default.object,
  perms: _propTypes2.default.instanceOf(_immutable2.default.Map)
};

function Header(props) {
  var history = props.history,
      intl = props.intl,
      config = props.config,
      perms = props.perms,
      screenName = props.screenName;


  return _react2.default.createElement(
    'header',
    null,
    _react2.default.createElement(
      'div',
      { className: _Banner2.default.common },
      _react2.default.createElement(
        'div',
        { className: _BannerMain2.default.common },
        _react2.default.createElement(_Logo2.default, { config: config }),
        _react2.default.createElement(_QuickSearchFormContainer2.default, {
          history: history,
          intl: intl,
          config: config,
          perms: perms
        })
      ),
      _react2.default.createElement(
        'div',
        { className: _BannerRight2.default.common },
        _react2.default.createElement(_UserMenu2.default, { screenName: screenName })
      )
    ),
    _react2.default.createElement(_NavBar2.default, { perms: perms })
  );
}

Header.propTypes = propTypes;

exports.default = (0, _reactIntl.injectIntl)((0, _withConfig2.default)(Header));