UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

34 lines (33 loc) 1.06 kB
import { jsxs as c, jsx as n, Fragment as u } from "react/jsx-runtime"; import { Fragment as d } from "react"; function i({ items: r, maxItemCount: l = 4 }) { const t = r.length > l; return t && (r = r.slice(-l)), /* @__PURE__ */ c("div", { className: "Breadcrumbs", children: [ r.length > 0 && /* @__PURE__ */ n("span", { children: "You are in: " }), t && /* @__PURE__ */ c(u, { children: [ /* @__PURE__ */ n("button", { className: "BreadcrumbItem Current", children: "..." }), /* @__PURE__ */ n("span", { children: ">" }) ] }), r.map((e, a) => /* @__PURE__ */ c(d, { children: [ /* @__PURE__ */ n( "button", { className: `BreadcrumbItem ${e.isCurrent ? "Current" : ""}`, onClick: (s) => { s.preventDefault(), e.action && e.action(); }, children: e.name }, a ), a !== r.length - 1 && /* @__PURE__ */ n("span", { children: ">" }) ] }, a)) ] }); } export { i as Breadcrumbs }; //# sourceMappingURL=Breadcrumbs.js.map