import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React from 'react';
import { Box } from '../box';
import IconButton from '../iconButton';
import { IconArrowLeftMediumOutline, IconArrowRightMediumOutline, IconArrowLeftSmallOutline, IconArrowRightSmallOutline } from '@teamleader/ui-icons';
import theme from './theme.css';
import cx from '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.createElement(Box, {
    className: cx(className, _defineProperty({}, theme['navBar-with-month-picker'], withMonthPicker)),
    display: "flex",
    justifyContent: "space-between"
  }, /*#__PURE__*/React.createElement(IconButton, {
    color: "teal",
    size: size === 'large' ? 'medium' : 'small',
    icon: size === 'large' ? /*#__PURE__*/React.createElement(IconArrowLeftMediumOutline, null) : /*#__PURE__*/React.createElement(IconArrowLeftSmallOutline, null),
    onClick: handlePreviousClick,
    title: previousMonthButtonLabel
  }), /*#__PURE__*/React.createElement(IconButton, {
    color: "teal",
    size: size === 'large' ? 'medium' : 'small',
    icon: size === 'large' ? /*#__PURE__*/React.createElement(IconArrowRightMediumOutline, null) : /*#__PURE__*/React.createElement(IconArrowRightSmallOutline, null),
    onClick: handleNextClick,
    title: nextMonthButtonLabel
  }));
};

export default NavigationBar;