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

104 lines (103 loc) 3.04 kB
import { jsx as e, jsxs as n, Fragment as c } from "react/jsx-runtime"; import { Breadcrumbs as d } from "../../Breadcrumbs/Breadcrumbs.js"; import { Box as l } from "@mui/material"; import { useMemo as f } from "react"; import { createMemoryRouter as p, createBrowserRouter as R, RouterProvider as h, useParams as u, Navigate as S, useLocation as y, Outlet as a } from "react-router"; import { RouterProvider as b } from "react-router/dom"; import g from "../SubmissionPage/SubmissionPage.js"; import { SUBMISSION_ID_PARAM as x, USER_ACCESS_HISTORY_SUBMISSION_SUBPATH as m } from "./RouteConstants.js"; import { UserAccessRequestHistoryPage as P } from "./UserAccessRequestHistoryPage.js"; function A() { const { submissionId: r } = u(); return r ? /* @__PURE__ */ e(g, { submissionId: r, isReviewer: !1 }) : /* @__PURE__ */ e(S, { to: "/" }); } function H() { return /* @__PURE__ */ n(c, { children: [ /* @__PURE__ */ e("div", { className: "pageHeader", children: /* @__PURE__ */ e("div", { className: "grid", children: /* @__PURE__ */ e("h3", { className: "pageHeaderTitle", children: "Access Requests" }) }) }), /* @__PURE__ */ e(l, { sx: { px: 5, py: 3 }, children: /* @__PURE__ */ e(a, {}) }) ] }); } function I() { const { submissionId: r } = u(), t = y(), s = [ { text: "Access Request History", to: "/", current: t.pathname === "/" } ]; if (r) { const o = `/${m}/${r}`; s.push({ text: `Request #${r}`, to: o, current: t.pathname === o }); } return /* @__PURE__ */ n(c, { children: [ /* @__PURE__ */ e( d, { items: s, sx: { mt: 2, mb: 4, "& .MuiLink-root": { color: "text.secondary", letterSpacing: 0, "&:visited": { color: "text.secondary" } }, "& .MuiSvgIcon-root": { color: "grey.500" } } } ), /* @__PURE__ */ e(a, {}) ] }); } const i = [ { element: /* @__PURE__ */ e(H, {}), children: [ { path: "/", children: [ { index: !0, element: /* @__PURE__ */ e(P, {}) }, { // Do not display the breadcrumbs on the `index` page element: /* @__PURE__ */ e(I, {}), children: [ { path: `${m}`, children: [ { path: `:${x}`, element: /* @__PURE__ */ e(A, {}) } ] } ] } ] } ] } ]; function O(r) { const { routerBaseName: t = "/RequestHistory:default", useMemoryRouter: s = !1 } = r, o = f(() => s ? p(i, { basename: t }) : R(i, { basename: t }), [s, t]); return s ? /* @__PURE__ */ e(h, { router: o }) : /* @__PURE__ */ e(b, { router: o }); } export { O as UserAccessRequestHistoryPlace, O as default }; //# sourceMappingURL=UserAccessRequestHistoryPlace.js.map