"use strict";

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

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

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

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

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

var _tooltip = _interopRequireDefault(require("../tooltip"));

var _typography = require("../typography");

var TooltippedIconButton = (0, _tooltip.default)(_iconButton.default);

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.default.createElement(_box.default, {
    display: "flex",
    borderRightWidth: 1,
    marginRight: 2
  }, options.map(function (optionType) {
    return /*#__PURE__*/_react.default.createElement(TooltippedIconButton, {
      "data-wysiwyg": true,
      tooltip: /*#__PURE__*/_react.default.createElement(_typography.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
    });
  }));
};

var _default = ListStylingOptions;
exports.default = _default;