"use strict";

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

var _react = _interopRequireDefault(require("react"));

var _reactRouterDom = require("react-router-dom");

var _jsxRuntime = require("react/jsx-runtime");

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

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

var BreadcrumbNav = function BreadcrumbNav(_ref) {
  var list = _ref.list;
  var navs = list.map(function (nav, i) {
    var comp = null;

    if (typeof nav === "string") {
      comp = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
        className: "text-xl font-semibold whitespace-nowrap mr-1",
        children: nav
      }, nav);
    } else if (_typeof(nav) === "object" && nav.to && nav.title) {
      comp = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.Link, {
        to: nav.to,
        className: "text-blue-600 text-xl font-semibold whitespace-nowrap mr-1",
        children: nav.title
      }, nav.to);
    } else {
      /* eslint-disable react/no-array-index-key */
      comp = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
        className: "mr-1",
        children: nav
      }, "bc-".concat(i));
      /* eslint-enable react/no-array-index-key */
    }

    return [comp,
    /*#__PURE__*/
    // eslint-disable-next-line react/no-array-index-key
    (0, _jsxRuntime.jsx)("span", {
      className: "text-gray-400 text-2xl mr-1",
      children: "/"
    }, "spacer-".concat(i))];
  }).flat().slice(0, -1);
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    className: "flex items-center flex-shrink-0",
    children: navs
  });
};

exports.BreadcrumbNav = BreadcrumbNav;