"use strict";

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

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

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

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

var _box = require("../box");

var _iconButton = _interopRequireDefault(require("../iconButton"));

var _uiIcons = require("@teamleader/ui-icons");

var _theme = _interopRequireDefault(require("./theme.css"));

var _classnames = _interopRequireDefault(require("classnames"));

var NavigationBar = function NavigationBar(_ref) {
  var className = _ref.className,
      localeUtils = _ref.localeUtils,
      nextMonth = _ref.nextMonth,
      previousMonth = _ref.previousMonth,
      size = _ref.size,
      withMonthPicker = _ref.withMonthPicker,
      onNextClick = _ref.onNextClick,
      onPreviousClick = _ref.onPreviousClick;
  var months = localeUtils.getMonths();
  var previousMonthButtonLabel = months[previousMonth.getMonth()];
  var nextMonthButtonLabel = months[nextMonth.getMonth()];

  var handlePreviousClick = function handlePreviousClick() {
    onPreviousClick && onPreviousClick();
  };

  var handleNextClick = function handleNextClick() {
    onNextClick && onNextClick();
  };

  return /*#__PURE__*/_react.default.createElement(_box.Box, {
    className: (0, _classnames.default)(className, (0, _defineProperty2.default)({}, _theme.default['navBar-with-month-picker'], withMonthPicker)),
    display: "flex",
    justifyContent: "space-between"
  }, /*#__PURE__*/_react.default.createElement(_iconButton.default, {
    color: "teal",
    size: size === 'large' ? 'medium' : 'small',
    icon: size === 'large' ? /*#__PURE__*/_react.default.createElement(_uiIcons.IconArrowLeftMediumOutline, null) : /*#__PURE__*/_react.default.createElement(_uiIcons.IconArrowLeftSmallOutline, null),
    onClick: handlePreviousClick,
    title: previousMonthButtonLabel
  }), /*#__PURE__*/_react.default.createElement(_iconButton.default, {
    color: "teal",
    size: size === 'large' ? 'medium' : 'small',
    icon: size === 'large' ? /*#__PURE__*/_react.default.createElement(_uiIcons.IconArrowRightMediumOutline, null) : /*#__PURE__*/_react.default.createElement(_uiIcons.IconArrowRightSmallOutline, null),
    onClick: handleNextClick,
    title: nextMonthButtonLabel
  }));
};

var _default = NavigationBar;
exports.default = _default;