@premieroctet/next-admin
Version:
Next-Admin provides a customizable and turnkey admin dashboard for applications built with Next.js and powered by the Prisma ORM. It aims to simplify the development process by providing a turnkey admin system that can be easily integrated into your proje
70 lines (69 loc) • 3.87 kB
JavaScript
import { jsx, jsxs } from "react/jsx-runtime";
import { HomeIcon } from "@heroicons/react/24/outline";
import Link_mjs_default from "./common/Link.mjs";
import { useConfig } from "../context/ConfigContext.mjs";
import ResourceIcon_mjs_default from "./common/ResourceIcon.mjs";
function Breadcrumb({ breadcrumbItems }) {
const { basePath } = useConfig();
return /*#__PURE__*/ jsx("nav", {
className: "flex h-[40px]",
"aria-label": "Breadcrumb",
children: /*#__PURE__*/ jsxs("ol", {
role: "list",
className: "flex flex-wrap items-center gap-2",
children: [
/*#__PURE__*/ jsx("li", {
children: /*#__PURE__*/ jsx("div", {
children: /*#__PURE__*/ jsxs("a", {
href: basePath,
className: "text-nextadmin-menu-default dark:text-dark-nextadmin-menu-color hover:text-nextadmin-content-emphasis dark:hover:text-dark-nextadmin-content-emphasis",
children: [
/*#__PURE__*/ jsx(HomeIcon, {
className: "h-5 w-5 flex-shrink-0",
"aria-hidden": "true"
}),
/*#__PURE__*/ jsx("span", {
className: "sr-only",
children: "Home"
})
]
})
})
}),
breadcrumbItems.map((page)=>/*#__PURE__*/ jsx("li", {
children: /*#__PURE__*/ jsxs("div", {
className: "flex items-center",
title: page.label,
children: [
/*#__PURE__*/ jsx("svg", {
className: "text-next-admin-menu-default dark:text-dark-nextadmin-menu-color h-5 w-5 flex-shrink-0",
fill: "currentColor",
viewBox: "0 0 20 20",
"aria-hidden": "true",
children: /*#__PURE__*/ jsx("path", {
d: "M5.555 17.776l8-16 .894.448-8 16-.894-.448z"
})
}),
/*#__PURE__*/ jsxs(Link_mjs_default, {
href: page.href,
className: `hover:text-nextadmin-brand-emphasis dark:hover:text-dark-nextadmin-brand-emphasis ml-2 flex gap-2 text-sm font-medium ${page.current ? "text-nextadmin-brand-subtle dark:text-dark-nextadmin-brand-subtle" : "text-nextadmin-menu-default dark:text-dark-nextadmin-menu-color"} `,
"aria-current": page.current ? "page" : void 0,
children: [
!!page.icon && /*#__PURE__*/ jsx(ResourceIcon_mjs_default, {
icon: page.icon,
className: "h-5 w-5"
}),
/*#__PURE__*/ jsx("span", {
className: "flex-basis-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap",
children: page.label
})
]
})
]
})
}, page.label))
]
})
});
}
export { Breadcrumb as default };