'use strict';

var jsxRuntime = require('react/jsx-runtime');
var react = require('@chakra-ui/react');
var md = require('react-icons/md');
var reactRouterDom = require('react-router-dom');

function Breadcrumbs(props) {
  const { items = [], showHomeIcon = true } = props;
  const alignItems = "flex-end";
  const borderRadius = "sm";
  const px = "1";
  return /* @__PURE__ */ jsxRuntime.jsxs(
    react.Breadcrumb,
    {
      spacing: 3,
      size: "sm",
      separator: /* @__PURE__ */ jsxRuntime.jsx(md.MdChevronRight, { size: "1.2rem" }),
      alignItems,
      sx: { ol: { display: "flex", alignItems } },
      fontSize: "sm",
      children: [
        showHomeIcon && /* @__PURE__ */ jsxRuntime.jsx(react.BreadcrumbItem, { alignItems, children: /* @__PURE__ */ jsxRuntime.jsx(
          react.BreadcrumbLink,
          {
            as: reactRouterDom.NavLink,
            to: "/",
            "aria-label": "Home",
            borderRadius,
            children: /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineHome, { size: "1.2rem" })
          }
        ) }),
        items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx(react.BreadcrumbItem, { position: "relative", alignItems, children: /* @__PURE__ */ jsxRuntime.jsxs(
          react.BreadcrumbLink,
          {
            as: reactRouterDom.NavLink,
            to: item.to,
            _hover: {
              textDecoration: "none",
              ".BreadcrumbHeading": { textDecoration: "none" },
              ".BreadcrumbText": { textDecoration: "underline" }
            },
            borderRadius,
            px,
            mx: -px,
            children: [
              item.heading && /* @__PURE__ */ jsxRuntime.jsx(
                react.Box,
                {
                  className: "BreadcrumbHeading",
                  fontWeight: "400",
                  textTransform: "lowercase",
                  display: "block",
                  mb: "-0.5",
                  children: item.heading
                }
              ),
              /* @__PURE__ */ jsxRuntime.jsx(react.Box, { className: "BreadcrumbText", fontWeight: "500", children: item.name })
            ]
          }
        ) }, i))
      ]
    }
  );
}

module.exports = Breadcrumbs;
//# sourceMappingURL=Breadcrumbs.cjs.map
