import { clsx } from 'clsx';
import { forwardRef } from 'react';
import Chevron from '../chevron/Chevron.mjs';
import Option from '../common/Option/Option.mjs';
import { jsx } from 'react/jsx-runtime';
import { Position } from '../common/propsValues/position.mjs';

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

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