"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactRouterDom = require("react-router-dom");
require("./NavLink.css");
var _jsxRuntime = require("react/jsx-runtime");
function NavLink(_ref) {
  let to = _ref.to,
    href = _ref.href,
    children = _ref.children,
    _ref$variant = _ref.variant,
    variant = _ref$variant === void 0 ? 'secondary' : _ref$variant,
    _ref$theme = _ref.theme,
    theme = _ref$theme === void 0 ? 'light' : _ref$theme,
    testId = _ref.testId,
    _ref$external = _ref.external,
    external = _ref$external === void 0 ? false : _ref$external;
  const className = ['nav-link', "nav-link--".concat(variant), theme === 'dark' ? 'nav-link--on-dark' : ''].filter(Boolean).join(' ');
  if (external || href) {
    return /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
      href: href,
      className: className,
      "data-testid": testId,
      target: "_blank",
      rel: "noreferrer",
      children: children
    });
  }
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.Link, {
    to: to,
    className: className,
    "data-testid": testId,
    children: children
  });
}
var _default = exports.default = NavLink;