import React from 'react';
import { appearancePropsMap } from './appearancePropsMap';
export var getDropdownOption = function getDropdownOption(intl, dispatchCommand, _ref) {
  var disabled = _ref.disabled,
    _onClick = _ref.onClick,
    selected = _ref.selected,
    appearance = _ref.appearance,
    testId = _ref.testId,
    tooltip = _ref.tooltip,
    description = _ref.description;
  var _appearancePropsMap = appearancePropsMap[appearance !== null && appearance !== void 0 ? appearance : 'url'],
    title = _appearancePropsMap.title,
    Icon = _appearancePropsMap.icon;
  return {
    title: intl.formatMessage(title),
    icon: /*#__PURE__*/React.createElement(Icon, {
      label: intl.formatMessage(title)
    }),
    onClick: function onClick() {
      return dispatchCommand(_onClick);
    },
    disabled: Boolean(disabled),
    testId: testId,
    selected: selected,
    tooltip: tooltip !== null && tooltip !== void 0 ? tooltip : '',
    description: description
  };
};