'use strict';

var clsx = require('clsx');
var ActionButton = require('../actionButton/ActionButton.js');
var Option = require('../common/Option/Option.js');
var jsxRuntime = require('react/jsx-runtime');
var control = require('../common/propsValues/control.js');

const ActionOption = ({
  action,
  priority = control.Priority.PRIMARY,
  disabled,
  onClick,
  media,
  title,
  content,
  complex,
  className,
  showMediaAtAllSizes,
  showMediaCircle,
  isContainerAligned,
  as
}) => {
  const sharedProps = {
    media,
    title,
    content,
    complex,
    disabled,
    showMediaAtAllSizes,
    showMediaCircle,
    className: clsx.clsx('tw-action-option', className),
    isContainerAligned,
    as
  };
  const getAriaLabel = () => {
    const labels = [];
    if (typeof title === 'string') {
      labels.push(title);
    }
    if (typeof action === 'string') {
      labels.push(action);
    }
    return labels.join(', ') || undefined;
  };
  return /*#__PURE__*/jsxRuntime.jsx(Option, {
    ...sharedProps,
    button: /*#__PURE__*/jsxRuntime.jsx(ActionButton, {
      priority: priority,
      disabled: disabled,
      "aria-label": getAriaLabel(),
      onClick: onClick,
      children: action
    })
  });
};

module.exports = ActionOption;
//# sourceMappingURL=ActionOption.js.map
