synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
36 lines (35 loc) • 1.27 kB
JavaScript
import { jsx as o, Fragment as c } from "react/jsx-runtime";
import d from "../../../../../synapse-queries/entity/useEntityBundle.js";
import { Skeleton as s, Tooltip as p } from "@mui/material";
import { useMutation as m } from "@tanstack/react-query";
import { displayToast as u } from "../../../../ToastMessage/ToastMessage.js";
import { copyStringToClipboard as f } from "../../../../../utils/functions/StringUtils.js";
function D(e) {
const { row: n } = e, { data: r, isLoading: l } = d(
n.original.entityId,
n.original.versionNumber
), { mutate: a } = m({
mutationFn: (t) => f(t),
onSuccess: () => u("MD5 copied to the clipboard", "success")
});
if (l)
return /* @__PURE__ */ o(s, { width: 100 });
const i = r?.fileHandles.find(
(t) => t.isPreview !== !0
);
return i?.contentMd5 == null ? /* @__PURE__ */ o(c, {}) : /* @__PURE__ */ o(p, { title: "Click to copy MD5 to your clipboard", placement: "right", children: /* @__PURE__ */ o(
"button",
{
className: "md5Button",
"aria-label": "MD5",
onClick: (t) => {
t.stopPropagation(), a(i?.contentMd5 ?? "");
},
children: i?.contentMd5
}
) });
}
export {
D as FileEntityMD5Cell
};
//# sourceMappingURL=FileEntityMD5Cell.js.map