synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
125 lines (124 loc) • 4.99 kB
JavaScript
import { jsxs as r, jsx as t } from "react/jsx-runtime";
import c from "../../../utils/ConditionalWrapper.js";
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 "@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 "react";
import "../../../../utils/context/SynapseContext.js";
import "use-deep-compare-effect";
import { Box as l, Stack as e, Skeleton as s, Avatar as f, Typography as g } 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 { isDockerRepository as x } from "../../../../utils/types/IsType.js";
import h from "../../../../synapse-queries/entity/useEntityBundle.js";
import u from "../../../favorites/FavoriteButton.js";
import w, { type2SvgIconName as I } from "../../../IconSvg/IconSvg.js";
import v from "../action_menu/EntityActionMenu.js";
import { EntityTitleBarVersionInfo as S } from "./EntityTitleBarVersionInfo.js";
import T from "./TitleBarProperties.js";
function mt(n) {
const { entityId: p, versionNumber: m, entityActionMenuProps: o } = n, d = o?.actionConfiguration.SHOW_VERSION_HISTORY?.onClick, { data: i, isLoading: a } = h(
p,
m
), y = i?.entity && x(i.entity) ? i.entity.repositoryName : i?.entity?.name;
return /* @__PURE__ */ r("div", { children: [
/* @__PURE__ */ t(
l,
{
sx: {
padding: "20px 40px",
backgroundColor: "grey.100"
},
children: /* @__PURE__ */ r(
e,
{
sx: {
flexDirection: { xs: "column", sm: "row" }
},
children: [
/* @__PURE__ */ r(
e,
{
direction: "row",
sx: {
alignItems: "center",
flexGrow: 1
},
children: [
/* @__PURE__ */ t(
c,
{
condition: a,
wrapper: s,
wrapperProps: {
variant: "circular"
},
children: /* @__PURE__ */ t(f, { sx: { bgcolor: "grey.300", height: 48, width: 48 }, children: i?.entityType && /* @__PURE__ */ t(
w,
{
icon: i?.entityType ? I[i.entityType] : "file",
wrap: !1,
sx: { color: "grey.700" }
}
) })
}
),
/* @__PURE__ */ r(l, { sx: { marginLeft: "10px", flexGrow: 1 }, children: [
/* @__PURE__ */ r(
e,
{
direction: "row",
sx: {
alignItems: "center",
gap: "3px"
},
children: [
/* @__PURE__ */ t(c, { condition: a, wrapper: s, children: /* @__PURE__ */ t(g, { variant: "headline2", children: y ?? "Name not set" }) }),
i?.entity?.id && /* @__PURE__ */ t(u, { entityId: i.entity.id })
]
}
),
/* @__PURE__ */ t(
S,
{
entityId: p,
versionNumber: m,
toggleShowVersionHistory: d
}
)
] })
]
}
),
o && /* @__PURE__ */ t(v, { ...o })
]
}
)
}
),
/* @__PURE__ */ t(T, { ...n })
] });
}
export {
mt as default
};
//# sourceMappingURL=EntityPageTitleBar.js.map