"use strict";

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

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

var _reactRedux = require("react-redux");

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _loggedIn = _interopRequireDefault(require("./logged-in"));

var _version = _interopRequireDefault(require("./version"));

var _designSystem = require("../design-system");

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

const NavBar = (0, _styledComponents.default)(_designSystem.Box).withConfig({
  displayName: "top-bar__NavBar",
  componentId: "sc-1qk1nql-0"
})(["height:", ";border-bottom:1px solid ", ";background:", ";display:flex;flex-direction:row;flex-shrink:0;"], ({
  theme
}) => theme.sizes.navbarHeight, ({
  theme
}) => theme.colors.greyPale, ({
  theme
}) => theme.colors.white);

const TopBar = props => {
  const {
    session,
    versions,
    paths
  } = props;
  return _react.default.createElement(NavBar, null, _react.default.createElement(_version.default, {
    versions: versions
  }), session && session.email ? _react.default.createElement(_loggedIn.default, {
    session: session,
    paths: paths
  }) : '');
};

const mapStateToProps = state => ({
  session: state.session,
  paths: {
    logoutPath: state.paths.logoutPath
  },
  versions: state.versions
});

var _default = (0, _reactRedux.connect)(mapStateToProps)(TopBar);

exports.default = _default;