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

61 lines (59 loc) 1.84 kB
import { jsxs as i, Fragment as c, jsx as a } from "react/jsx-runtime"; import { useState as m } from "react"; import { Tooltip as p } from "@mui/material"; import d from "../IconSvg/IconSvg.js"; import { ProgrammaticInstructionsModal as h } from "../ProgrammaticInstructionsModal/ProgrammaticInstructionsModal.js"; import { TOOLTIP_DELAY_SHOW as f } from "../SynapseTable/SynapseTableConstants.js"; const O = `import synapseclient syn = synapseclient.Synapse() syn.login(authToken="YOUR_TOKEN_HERE") `, _ = `library(synapser) synLogin(authToken="YOUR_TOKEN_HERE") `; function w({ entityId: o, version: t }) { const [e, n] = m(!1), r = `${_} # Obtain a pointer and download the data ${o} <- synGet(entity='${o}'${t ? `, version=${t}` : ""} ) `, l = `${O} # Obtain a pointer and download the data ${o} = syn.get(entity='${o}'${t ? `, version=${t}` : ""} ) # Get the path to the local copy of the data file filepath = ${o}.path`, s = `synapse get ${o} ${t ? `--version ${t}` : ""}`; return /* @__PURE__ */ i(c, { children: [ /* @__PURE__ */ a( p, { title: "Programmatic download options", enterNextDelay: f, placement: "left", children: /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a( "button", { className: "btn-download-icon", onClick: () => n(!0), children: /* @__PURE__ */ a(d, { icon: "code" }) } ) }) } ), e && /* @__PURE__ */ a( h, { show: !0, onClose: () => n(!1), title: "Download Programmatically", cliCode: s, rCode: r, pythonCode: l } ) ] }); } export { O as PYTHON_CLIENT_IMPORT_AND_LOGIN, _ as R_CLIENT_IMPORT_AND_LOGIN, w as default }; //# sourceMappingURL=DirectProgrammaticDownload.js.map