import React from 'react';
import Box from '../box';
import IconButton from '../iconButton';
import Tooltip from '../tooltip';
import { TextSmall } from '../typography';
var TooltippedIconButton = Tooltip(IconButton);

var ListStylingOptions = function ListStylingOptions(_ref) {
  var _ref$config = _ref.config,
      options = _ref$config.options,
      unorderedIcon = _ref$config.unordered.icon,
      orderedIcon = _ref$config.ordered.icon,
      currentState = _ref.currentState,
      onChange = _ref.onChange,
      translations = _ref.translations;
  var iconsByOptionType = {
    unordered: unorderedIcon,
    ordered: orderedIcon
  };
  return /*#__PURE__*/React.createElement(Box, {
    display: "flex",
    borderRightWidth: 1,
    marginRight: 2
  }, options.map(function (optionType) {
    return /*#__PURE__*/React.createElement(TooltippedIconButton, {
      "data-wysiwyg": true,
      tooltip: /*#__PURE__*/React.createElement(TextSmall, null, translations["components.controls.list.".concat(optionType)]),
      tooltipSize: "small",
      tooltipShowDelay: 1000,
      icon: iconsByOptionType[optionType],
      color: "black",
      key: optionType,
      onClick: function onClick() {
        return onChange(optionType);
      },
      selected: currentState.listType === optionType,
      marginRight: 2
    });
  }));
};

export default ListStylingOptions;