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

103 lines (95 loc) 2.78 kB
import { jsx as t, jsxs as c } from "react/jsx-runtime"; import { Button as f, Box as i, Typography as d, Link as u } from "@mui/material"; import { DialogBase as T } from "../DialogBase.js"; import { useMemo as g } from "react"; import { copyStringToClipboard as x } from "../../utils/functions/StringUtils.js"; import { displayToast as A } from "../ToastMessage/ToastMessage.js"; function w(p) { const { createDoiHelpUrl: s, open: m, onClose: h, portalAcknowledgement: n, dataAvailabilityStatement: r, studyAcknowledgements: o } = p, a = g(() => { let e = ""; return n && (e += `PORTAL ACKNOWLEDGEMENT STATEMENT ${n} `), o && o.length > 0 && (e += `STUDY-SPECIFIC ACKNOWLEDGEMENT STATEMENTS: `, o.forEach((l) => { e += `* ${l.title} ${l.statement} `; })), r && (e += `DATA AVAILABILITY STATEMENT ${r} `), e.trim(); }, [n, r, o]); return /* @__PURE__ */ t( T, { title: "Acknowledgement Text", open: m, onCancel: h, maxWidth: "md", content: /* @__PURE__ */ c(i, { sx: { display: "flex", flexDirection: "column", gap: "10px" }, children: [ /* @__PURE__ */ t( i, { sx: { p: "12px", backgroundColor: "#FBF4E0", height: "fit-content" }, children: /* @__PURE__ */ c(d, { variant: "body1", children: [ /* @__PURE__ */ t("strong", { children: "Note:" }), " You must customize the text in the Data Availability Statement to match the contents used in your publication.", " ", /* @__PURE__ */ t( u, { href: s, target: "_blank", rel: "noopener noreferrer", children: "How do I generate a DOI for my dataset?" } ) ] }) } ), /* @__PURE__ */ t( i, { sx: { p: "10px", backgroundColor: "grey.200", whiteSpace: "pre-wrap", wordBreak: "break-word", height: "250px", overflow: "auto" }, children: /* @__PURE__ */ t(d, { variant: "body1", children: a }) } ) ] }), actions: /* @__PURE__ */ t( f, { variant: "contained", color: "primary", onClick: () => { x(a).then(() => { A("Successfully copied to clipboard", "success"); }); }, children: "Copy to Clipboard" } ) } ); } export { w as AcknowledgementsDialog, w as default }; //# sourceMappingURL=AcknowledgementsDialog.js.map