synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
130 lines (129 loc) • 4.39 kB
JavaScript
import { jsx as t, jsxs as o } from "react/jsx-runtime";
import { ReactComponent as F } from "../../assets/homepage/egress.svg.js";
import { ReactComponent as I } from "../../assets/homepage/users.svg.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 { getEndpoint as N, BackendDestinationEnum as R } from "../../utils/functions/getEndpoint.js";
import "lodash-es";
import "@sage-bionetworks/synapse-client/util/synapseClientFetch";
import "@tanstack/react-query";
import "../../utils/PermissionLevelToAccessType.js";
import "../../utils/SynapseConstants.js";
import "react";
import "../../utils/context/SynapseContext.js";
import "use-deep-compare-effect";
import { useTheme as S, Box as i, Typography as p } 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 { useGetEntityHeader as D } from "../../synapse-queries/entity/useGetEntityHeaders.js";
import { calculateFriendlyFileSize as P } from "../../utils/functions/calculateFriendlyFileSize.js";
import { NavigateNext as z } from "@mui/icons-material";
const _ = Intl.NumberFormat("en"), $ = {
gridTemplateColumns: {
xs: "100px auto 40px",
sm: "100px auto 170px 150px 40px"
}
};
function bt({
rank: a,
rowValues: r,
entityIdColIndex: y,
nUniqueUsersColIndex: h,
egressSizeGbColIndex: u,
projectDescriptionColumnIndex: b,
altLinkColIndex: g,
isMobileView: n
}) {
const k = S(), m = r[y], c = r[u], d = r[g], { data: v } = D(m, void 0, {
enabled: !!m
}), C = c ? P(parseFloat(c) * 1e9) : "", T = r[b], l = r[h], j = l ? _.format(parseInt(l)) : "";
let e = k.palette.primary[700], s;
switch (a) {
case 1:
e = "#447A74", s = "12px 12px 0px 0px";
break;
case 2:
e = "#33575E";
break;
case 3:
e = "#294251";
break;
case 10:
s = "0px 0px 12px 12px";
break;
}
const E = T ?? v?.name, x = /* @__PURE__ */ o(p, { variant: "body1", children: [
/* @__PURE__ */ t(F, {}),
C
] }), f = /* @__PURE__ */ o(p, { variant: "body1", children: [
/* @__PURE__ */ t(I, {}),
j
] });
return /* @__PURE__ */ t(
"div",
{
onClick: () => {
d ? window.open(d, "_blank") : window.open(
`${N(
R.PORTAL_ENDPOINT
)}Synapse:${m}`,
"_blank"
);
},
children: /* @__PURE__ */ o(
i,
{
sx: {
color: "primary.100",
backgroundColor: e,
borderRadius: s,
"&:hover": {
color: "white",
cursor: "pointer",
filter: "brightness(105%)"
},
p: "15px 0px",
display: "grid",
...$,
justifyItems: "start",
svg: { m: "0 3px -3px 0" }
},
children: [
/* @__PURE__ */ t(p, { variant: "body1", sx: { ml: "30px" }, children: a }),
/* @__PURE__ */ o(i, { children: [
/* @__PURE__ */ t(p, { variant: "body1", children: E }),
n && /* @__PURE__ */ o(i, { sx: { display: "flex", flexDirection: "column" }, children: [
x,
f
] })
] }),
!n && x,
!n && f,
/* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(z, {}) })
]
}
)
}
);
}
export {
bt as SynapseTrendingProjectItem,
$ as trendingProjectsGridTemplateColumns
};
//# sourceMappingURL=SynapseTrendingProjectsItem.js.map