'use strict';

var clsx = require('clsx');
var React = require('react');
var Chevron = require('../chevron/Chevron.js');
var Option = require('../common/Option/Option.js');
var jsxRuntime = require('react/jsx-runtime');
var position = require('../common/propsValues/position.js');

const NavigationOption = /*#__PURE__*/React.forwardRef(({
  as: component = 'button',
  disabled = false,
  onClick,
  className,
  ...rest
}, reference) => {
  if ('href' in rest && rest.href) {
    component = 'a';
  }
  return /*#__PURE__*/jsxRuntime.jsx(Option, {
    ...rest,
    ref: reference,
    as: component,
    className: clsx.clsx('np-navigation-option', className),
    button: /*#__PURE__*/jsxRuntime.jsx(Chevron, {
      orientation: position.Position.RIGHT,
      disabled: disabled,
      className: "d-block"
    }),
    disabled: disabled,
    onClick: event => {
      if (disabled) {
        event.preventDefault();
        return;
      }
      if (onClick) {
        onClick(event);
      }
    }
  });
});

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