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

71 lines (70 loc) 3.08 kB
import { jsx as o, Fragment as l } from "react/jsx-runtime"; import a from "../../../../../synapse-queries/entity/useEntityBundle.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 { useSynapseContext as c } from "../../../../../utils/context/SynapseContext.js"; import "use-deep-compare-effect"; import { Box as u, Tooltip as f, IconButton as y } 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 { EntityType as m } from "@sage-bionetworks/synapse-client"; import "../../../../../utils/types/IsType.js"; import { useAddFileToDownloadList as g } from "../../../../../synapse-queries/download/useDownloadList.js"; import { displayFilesWereAddedToDownloadListSuccess as h } from "../../../../download_list/DownloadConfirmationUtils.js"; import w from "../../../../IconSvg/IconSvg.js"; import { displayToast as x } from "../../../../ToastMessage/ToastMessage.js"; function to(n) { const { row: p } = n, { entityId: i, versionNumber: r } = p.original, { data: e } = a(i, r), { downloadCartPageUrl: d } = c(), { mutate: s } = g({ onSuccess: () => { h(d); }, onError: (t) => { x(t.reason, "danger"); } }); return e?.entityType == m.file || e?.entityType == m.recordset ? /* @__PURE__ */ o( u, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ o(f, { title: "Add to Download List", placement: "right", children: /* @__PURE__ */ o( y, { sx: { height: "35px", width: "35px" }, onClick: (t) => { s({ entityId: i, entityVersionNumber: r }), t.stopPropagation(); }, children: /* @__PURE__ */ o(w, { icon: "download" }) } ) }) } ) : /* @__PURE__ */ o(l, {}); } export { to as AddFileToDownloadListCell }; //# sourceMappingURL=AddToDownloadListCell.js.map