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

99 lines (98 loc) 4.66 kB
import { jsxs as l, jsx as t } from "react/jsx-runtime"; import "../../../../synapse-client/SynapseClient.js"; import "@sage-bionetworks/synapse-client/generated/models/ErrorResponseCode"; import "@sage-bionetworks/synapse-client/generated/models/TwoFactorAuthErrorResponse"; import "@sage-bionetworks/synapse-client/util/SynapseClientError"; import { FeatureFlagEnum as y } from "@sage-bionetworks/synapse-types"; import "../../../../utils/functions/EntityTypeUtils.js"; import "../../../../utils/SynapseConstants.js"; import "lodash-es"; import "@sage-bionetworks/synapse-client/util/synapseClientFetch"; import "@tanstack/react-query"; import "../../../../utils/PermissionLevelToAccessType.js"; import { useState as f } from "react"; import "../../../../utils/context/SynapseContext.js"; import "use-deep-compare-effect"; import { Box as p, Stack as d, Link as g, Divider as v, Typography as c } from "@mui/material"; import "../../../../utils/hooks/useCookiePreferences.js"; import "../../../../utils/hooks/useSourceAppConfigs.js"; import "universal-cookie"; import "../../../../utils/AppUtils/session/ApplicationSessionContext.js"; import "../../../../utils/context/FullContextProvider.js"; import "../../../../utils/context/DocumentMetadataContext.js"; import '../../../../style/components/_spinner.css';/* empty css */ import "@tanstack/query-core"; import "lodash-es/isEmpty"; import "lodash-es/isEqual"; import "lodash-es/xorWith"; import "react-router"; import "@sage-bionetworks/synapse-client"; import "../../../../utils/types/IsType.js"; import b from "../../../../synapse-queries/entity/useEntityBundle.js"; import { useGetFeatureFlag as k } from "../../../../synapse-queries/featureflags/useGetFeatureFlag.js"; import C from "../../../AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js"; import { useGetEntityTitleBarProperties as F } from "./useGetEntityTitleBarProperties.js"; function n(m) { const { title: r, value: o } = m; return /* @__PURE__ */ l("tr", { children: [ /* @__PURE__ */ t("td", { style: { paddingRight: "1em" }, children: /* @__PURE__ */ t( c, { component: "span", variant: "smallText1", sx: { fontWeight: 700 }, children: r } ) }), /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(c, { component: "span", variant: "smallText1", children: o }) }) ] }); } function ot(m) { const { entityId: r, versionNumber: o, onActMemberClickAddConditionsForUse: u } = m, { data: s } = b(r, o), h = k(y.DESCRIPTION_FIELD), i = F(r, o), [a, x] = f(!1); return /* @__PURE__ */ l(p, { sx: { padding: "20px 40px" }, children: [ /* @__PURE__ */ l( d, { direction: "row", sx: { justifyContent: "space-between", alignItems: "flex-start" }, children: [ /* @__PURE__ */ l( d, { direction: "row", divider: /* @__PURE__ */ t(v, { orientation: "vertical", flexItem: !0 }), spacing: 2, sx: { alignItems: "flex-start" }, children: [ /* @__PURE__ */ t("table", { children: /* @__PURE__ */ t("tbody", { children: i.slice(0, 2).map((e) => /* @__PURE__ */ t(n, { title: e.title, value: e.value }, e.key)) }) }), i.length > 2 && /* @__PURE__ */ t("table", { children: /* @__PURE__ */ t("tbody", { children: i.slice(2, 4).map((e) => /* @__PURE__ */ t(n, { title: e.title, value: e.value }, e.key)) }) }), (i.length === 5 || i.length === 6) && /* @__PURE__ */ t("table", { children: /* @__PURE__ */ t("tbody", { children: i.slice(4, 6).map((e) => /* @__PURE__ */ t(n, { title: e.title, value: e.value }, e.key)) }) }), i.length > 6 && /* @__PURE__ */ t(g, { onClick: () => x((e) => !e), children: a ? "Hide properties" : `${i.length - 4} more properties` }) ] } ), /* @__PURE__ */ t( C, { entityId: r, onACTMemberClick: u } ) ] } ), a && /* @__PURE__ */ t(p, { sx: { pt: "20px" }, children: /* @__PURE__ */ t("table", { children: /* @__PURE__ */ t("tbody", { children: i.slice(4, 1 / 0).map((e) => /* @__PURE__ */ t(n, { title: e.title, value: e.value }, e.key)) }) }) }), s?.entity?.description && h && /* @__PURE__ */ t(p, { sx: { marginTop: "10px", maxWidth: "720px" }, children: s?.entity?.description }) ] }); } export { ot as default }; //# sourceMappingURL=TitleBarProperties.js.map