import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, defineProperty as _defineProperty } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
import React__default from 'react';
import cls from 'classnames';
import { classes } from '../../DateTimePicker.tokens.js';
import { StyledSeparator } from '../Popover/Popover.styles.js';
import { ShortcutsWrapper, ShortcutList, ShortcutItem, StyledCell, ShortcutTitleWrapper, ShortcutTitle } from './DateShortcutList.styles.js';

var _StyledSeparator;
var _excluded = ["items", "calendarContainerHeight", "dateShortcutsPlacement", "dateShortcutsWidth", "setShortcutDate"];
var DateShortcutList = function DateShortcutList(_ref) {
  var items = _ref.items,
    calendarContainerHeight = _ref.calendarContainerHeight,
    dateShortcutsPlacement = _ref.dateShortcutsPlacement,
    dateShortcutsWidth = _ref.dateShortcutsWidth,
    setShortcutDate = _ref.setShortcutDate,
    rest = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/React__default.createElement(ShortcutsWrapper, _extends({
    innerHeight: calendarContainerHeight,
    dateShortcutsPlacement: dateShortcutsPlacement
  }, rest), _StyledSeparator || (_StyledSeparator = /*#__PURE__*/React__default.createElement(StyledSeparator, null)), /*#__PURE__*/React__default.createElement(ShortcutList, {
    width: dateShortcutsWidth
  }, items.map(function (item) {
    return /*#__PURE__*/React__default.createElement(ShortcutItem, {
      tabIndex: item.disabled ? -1 : 0,
      className: cls(_defineProperty({}, classes.shortcutItemDisabled, item.disabled)),
      onClick: function onClick() {
        return setShortcutDate(item.value);
      }
    }, /*#__PURE__*/React__default.createElement(StyledCell, {
      contentLeft: item.contentLeft,
      contentRight: item.contentRight,
      stretching: "filled"
    }, /*#__PURE__*/React__default.createElement(ShortcutTitleWrapper, null, /*#__PURE__*/React__default.createElement(ShortcutTitle, null, item.label))));
  })));
};

export { DateShortcutList };
