"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = ToolNavBar;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _reactIntl = require("react-intl");
var _reactRouterDom = require("react-router-dom");
var _AdminNavBar = _interopRequireDefault(require("../../../styles/cspace-ui/AdminNavBar.css"));
var _AdminNavItem = _interopRequireDefault(require("../../../styles/cspace-ui/AdminNavItem.css"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const messages = (0, _reactIntl.defineMessages)({
  report: {
    "id": "toolNavBar.report",
    "defaultMessage": "Reports"
  },
  batch: {
    "id": "toolNavBar.batch",
    "defaultMessage": "Data Updates"
  },
  vocabulary: {
    "id": "toolNavBar.vocabulary",
    "defaultMessage": "Term Lists"
  }
});
const renderLinkItem = (basename, tab) => /*#__PURE__*/_react.default.createElement("li", {
  key: tab
}, /*#__PURE__*/_react.default.createElement(_reactRouterDom.NavLink, {
  to: `${basename}/${tab}`,
  className: _AdminNavItem.default.common,
  activeClassName: _AdminNavItem.default.active
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, messages[tab])));
const propTypes = {
  basename: _propTypes.default.string,
  tabs: _propTypes.default.arrayOf(_propTypes.default.string)
};
function ToolNavBar(props) {
  const {
    basename,
    tabs
  } = props;
  const items = tabs.map(tab => renderLinkItem(basename, tab));
  return /*#__PURE__*/_react.default.createElement("nav", {
    className: _AdminNavBar.default.common
  }, /*#__PURE__*/_react.default.createElement("ul", null, items));
}
ToolNavBar.propTypes = propTypes;