UNPKG

@pagamio/frontend-commons-lib

Version:

Pagamio library for Frontend reusable components like the form engine and table container

11 lines (10 loc) 900 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Breadcrumb } from 'flowbite-react'; import { useAppBreadcrumbs } from '../../context'; import { useTranslation } from '../../translations'; const AppBreadcrumbNav = () => { const { breadcrumbs, pathname, rootPageIcon: PageIcon } = useAppBreadcrumbs(); const { t } = useTranslation(); return (_jsx(Breadcrumb, { className: "mb-5", children: breadcrumbs.map((item, index) => (_jsx(Breadcrumb.Item, { href: index === breadcrumbs.length - 1 || !item.path ? undefined : item.path, children: _jsxs("div", { className: "flex items-center gap-x-3 text-2xl", children: [index === 0 && PageIcon && _jsx(PageIcon, {}), _jsx("span", { className: "text-sm dark:text-white", children: t(item.label) })] }) }, `breadcrumb-item-${item.path || item.key || index}-${item.label}`))) }, pathname)); }; export default AppBreadcrumbNav;