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) } })); }

import PropTypes from "prop-types";
import { Link } from "react-router";
import { jsx, css } from "@emotion/core";
var linkClass = 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 jsx("li", {
    css: linkClass,
    style: _objectSpread({}, boxStyle)
  }, jsx(Link, {
    className: "nav-item",
    to: pathTo
  }, jsx("span", {
    style: _objectSpread({}, linkStyle)
  }, name)));
};

NavRouterLink.propTypes = {
  name: PropTypes.string,
  path: PropTypes.string,
  customStyles: PropTypes.shape({})
};
export default NavRouterLink;