import { clsx } from 'clsx';
import Button from '../button/Button.resolver.mjs';
import '../common/theme.mjs';
import '../common/direction.mjs';
import '@transferwise/neptune-tokens';
import { Priority } from '../common/propsValues/control.mjs';
import '../common/propsValues/size.mjs';
import '../common/propsValues/typography.mjs';
import '../common/propsValues/width.mjs';
import '../common/propsValues/type.mjs';
import '../common/propsValues/dateMode.mjs';
import '../common/propsValues/monthFormat.mjs';
import '../common/propsValues/position.mjs';
import '../common/propsValues/layouts.mjs';
import '../common/propsValues/status.mjs';
import '../common/propsValues/sentiment.mjs';
import '../common/propsValues/profileType.mjs';
import '../common/propsValues/variant.mjs';
import '../common/propsValues/scroll.mjs';
import '../common/propsValues/markdownNodeType.mjs';
import '../common/fileType.mjs';
import '@transferwise/formatting';
import '@transferwise/icons';
import 'react';
import 'react-intl';
import '../common/closeButton/CloseButton.messages.mjs';
import { jsx } from 'react/jsx-runtime';
import Option from '../common/Option/Option.mjs';

const ActionOption = ({
  action,
  priority = Priority.PRIMARY,
  disabled,
  onClick,
  media,
  title,
  content,
  additionalContent,
  complex,
  className,
  showMediaAtAllSizes,
  showMediaCircle,
  isContainerAligned,
  as,
  'aria-label': ariaLabel
}) => {
  const sharedProps = {
    media,
    title,
    content,
    complex,
    disabled,
    showMediaAtAllSizes,
    showMediaCircle,
    className: clsx('tw-action-option', className),
    isContainerAligned,
    additionalContent,
    as
  };
  const getAriaLabel = () => {
    if (ariaLabel) {
      return ariaLabel;
    }
    const generatedLabels = [];
    if (typeof title === 'string') {
      generatedLabels.push(title);
    }
    if (typeof action === 'string') {
      generatedLabels.push(action);
    }
    return generatedLabels.join(', ') || undefined;
  };
  const mapPriority = priority => {
    switch (priority) {
      case 'primary':
        return 'primary';
      case 'secondary':
        return 'secondary-neutral';
      case 'tertiary':
        return 'tertiary';
      case 'secondary-send':
        return 'secondary';
      default:
        return 'primary';
    }
  };
  return /*#__PURE__*/jsx(Option, {
    ...sharedProps,
    button: /*#__PURE__*/jsx(Button, {
      v2: true,
      size: "sm",
      priority: mapPriority(priority),
      disabled: disabled,
      "aria-label": getAriaLabel(),
      onClick: onClick,
      children: action
    })
  });
};

export { ActionOption as default };
//# sourceMappingURL=ActionOption.mjs.map
