UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

28 lines 1 kB
import React from 'react'; import { appearancePropsMap } from './link-toolbar-button-group-options'; 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 }; };