'use strict';

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

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

exports.Action = Action;
//# sourceMappingURL=Action.js.map
