import { clsx } from 'clsx';
import Link from '../../link/Link.mjs';
import { Typography } from '../propsValues/typography.mjs';
import ActionButton from '../../actionButton/ActionButton.mjs';
import { Priority } from '../propsValues/control.mjs';
import { jsx } from 'react/jsx-runtime';

function Action({
  action,
  className,
  variant = 'button'
}) {
  if ('href' in action) {
    return /*#__PURE__*/jsx(Link, {
      href: action.href,
      className: className,
      "aria-label": action['aria-label'],
      target: action.target,
      type: Typography.LINK_LARGE,
      onClick: action.onClick,
      children: action.text
    });
  }
  return variant === 'button' ? /*#__PURE__*/jsx("button", {
    type: "button",
    "aria-label": action['aria-label'],
    className: clsx('btn-unstyled np-text-link-large', className),
    onClick: action.onClick,
    children: action.text
  }) : /*#__PURE__*/jsx(ActionButton, {
    "aria-label": action['aria-label'],
    priority: Priority.SECONDARY,
    className: clsx(className),
    onClick: action.onClick,
    children: action.text
  });
}

export { Action };
//# sourceMappingURL=Action.mjs.map
