"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _propTypes = _interopRequireDefault(require("prop-types"));

var _reactRouter = require("react-router");

var _core = require("@emotion/core");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _templateObject() {
  var data = _taggedTemplateLiteral(["\n  & > a {\n    color: rgba(255, 255, 255, 0.65);\n    flex: 1;\n    display: block;\n    font-family: \"Rubik\", sans-serif;\n    font-size: 1.25rem;\n    border: none;\n    text-transform: uppercase;\n    text-decoration: none;\n    padding: 1rem;\n    text-align: center;\n\n    &:focus,\n    &:hover,\n    &:active {\n      color: rgba(255, 255, 255, 0.85);\n    }\n\n    &:hover {\n      text-decoration: none;\n    }\n  }\n"]);

  _templateObject = function _templateObject() {
    return data;
  };

  return data;
}

function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

var linkClass = (0, _core.css)(_templateObject());

var pathOrName = function pathOrName(p, n) {
  return p || "/".concat(n.toLowerCase());
};

var NavRouterLink = function NavRouterLink(_ref) {
  var path = _ref.path,
      customStyles = _ref.customStyles,
      name = _ref.name;
  var boxStyle = customStyles ? customStyles.box : null;
  var linkStyle = customStyles ? customStyles.link : null;
  var pathTo = pathOrName(path, name);
  return (0, _core.jsx)("li", {
    css: linkClass,
    style: _objectSpread({}, boxStyle)
  }, (0, _core.jsx)(_reactRouter.Link, {
    className: "nav-item",
    to: pathTo
  }, (0, _core.jsx)("span", {
    style: _objectSpread({}, linkStyle)
  }, name)));
};

NavRouterLink.propTypes = {
  name: _propTypes["default"].string,
  path: _propTypes["default"].string,
  customStyles: _propTypes["default"].shape({})
};
var _default = NavRouterLink;
exports["default"] = _default;