import { clsx } from 'clsx';
import ActionButton from '../actionButton/ActionButton.mjs';
import Option from '../common/Option/Option.mjs';
import { jsx } from 'react/jsx-runtime';
import { Priority } from '../common/propsValues/control.mjs';

const ActionOption = ({
  action,
  priority = Priority.PRIMARY,
  disabled,
  onClick,
  media,
  title,
  content,
  complex,
  className,
  showMediaAtAllSizes,
  showMediaCircle,
  isContainerAligned,
  as
}) => {
  const sharedProps = {
    media,
    title,
    content,
    complex,
    disabled,
    showMediaAtAllSizes,
    showMediaCircle,
    className: 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__*/jsx(Option, {
    ...sharedProps,
    button: /*#__PURE__*/jsx(ActionButton, {
      priority: priority,
      disabled: disabled,
      "aria-label": getAriaLabel(),
      onClick: onClick,
      children: action
    })
  });
};

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