import MinusIcon from '@atlaskit/icon/core/minus';
import SmartLinkCardIcon from '@atlaskit/icon/core/smart-link-card';
import SmartLinkEmbedIcon from '@atlaskit/icon/core/smart-link-embed';
import SmartLinkInlineIcon from '@atlaskit/icon/core/smart-link-inline';
import { cardMessages as messages } from '../messages';
export const appearancePropsMap = {
  url: {
    title: messages.urlTitle,
    icon: MinusIcon
  },
  inline: {
    title: messages.inlineTitle,
    icon: SmartLinkInlineIcon
  },
  block: {
    title: messages.blockTitle,
    icon: SmartLinkCardIcon
  },
  embed: {
    title: messages.embedTitle,
    icon: SmartLinkEmbedIcon
  }
};
export const getButtonGroupOption = (intl, areAnyNewToolbarFlagsEnabled, dispatchCommand, {
  disabled,
  onClick,
  selected,
  appearance,
  testId,
  tooltip
}) => {
  const {
    title,
    icon
  } = appearancePropsMap[appearance !== null && appearance !== void 0 ? appearance : 'url'];
  return {
    title: intl.formatMessage(title),
    icon,
    onClick: () => dispatchCommand(onClick),
    disabled: Boolean(disabled),
    tooltipContent: tooltip || null,
    testId,
    selected,
    areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
  };
};