'use strict';

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

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _propTypes2 = _interopRequireDefault(_propTypes);

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

var _Logo2 = _interopRequireDefault(_Logo);

var _NavigationLogoPairWrapper = require('./styles/NavigationLogoPairWrapper');

var _NavigationLogoPairWrapper2 = _interopRequireDefault(_NavigationLogoPairWrapper);

var _NavigationHeading = require('./styles/NavigationHeading');

var _NavigationHeading2 = _interopRequireDefault(_NavigationHeading);

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

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var LogoHeader = function (_React$Component) {
  _inherits(LogoHeader, _React$Component);

  function LogoHeader() {
    _classCallCheck(this, LogoHeader);

    return _possibleConstructorReturn(this, (LogoHeader.__proto__ || Object.getPrototypeOf(LogoHeader)).apply(this, arguments));
  }

  _createClass(LogoHeader, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          children = _props.children,
          id = _props.id,
          className = _props.className,
          LogoPairWrapper = _props.LogoPairWrapper,
          Heading = _props.Heading;


      return _react2.default.createElement(
        LogoPairWrapper,
        { id: id, className: className },
        _react2.default.createElement(_Logo2.default, null),
        _react2.default.createElement(
          Heading,
          null,
          children
        )
      );
    }
  }]);

  return LogoHeader;
}(_react2.default.Component);

LogoHeader.propTypes = {
  /**
   * The title to render inside the header.
   */
  children: _propTypes2.default.string,
  /**
   * Adds a class name to the whole containing header element.
   */
  className: _propTypes2.default.string,
  /**
   * Adds an id to the whole containing header element.
   */
  id: _propTypes2.default.string,
  /**
   * A component to wrap the logo and heading text
   */
  LogoPairWrapper: _propTypes2.default.func,
  /**
   * A component to render the heading text
   */
  Heading: _propTypes2.default.func
};
LogoHeader.defaultProps = {
  children: 'Bandwidth',
  className: null,
  id: null,
  LogoPairWrapper: _NavigationLogoPairWrapper2.default,
  Heading: _NavigationHeading2.default
};
exports.default = LogoHeader;