synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
123 lines (122 loc) • 3.6 kB
JavaScript
import { jsx as n, jsxs as e, Fragment as a } from "react/jsx-runtime";
import { Box as u, Tabs as I, Tab as c, Typography as i, Link as L } from "@mui/material";
import { useState as R } from "react";
import { ConfirmationDialog as T } from "../ConfirmationDialog/ConfirmationDialog.js";
var B = /* @__PURE__ */ ((o) => (o.COMMAND_LINE = "Command Line", o.R = "R", o.PYTHON = "Python", o))(B || {});
const k = ({
show: o,
title: b,
onClose: m,
pythonNotes: v,
pythonCode: l,
rNotes: y,
rCode: h,
cliNotes: f,
cliCode: d,
helpMarkdown: p,
helpUrl: C
}) => {
let r;
d ? r = "Command Line" : l ? r = "Python" : r = "R";
const [t, P] = R(r), s = /* @__PURE__ */ e(i, { variant: "body1", children: [
"Installation instructions are available at our",
" ",
/* @__PURE__ */ n(
L,
{
href: "https://help.synapse.org/docs/Installing-Synapse-API-Clients.1985249668.html",
target: "_blank",
rel: "noopener noreferrer",
children: "Synapse API Documentation Site"
}
),
"."
] });
return /* @__PURE__ */ n(
T,
{
open: o,
title: b,
onCancel: m,
onConfirm: m,
maxWidth: "md",
titleHelpPopoverProps: p ? {
markdownText: p,
helpUrl: C
} : void 0,
content: /* @__PURE__ */ e(a, { children: [
/* @__PURE__ */ n(
u,
{
sx: {
borderBottom: 1,
borderColor: "divider",
marginBottom: 4
},
children: /* @__PURE__ */ e(
I,
{
value: t,
onChange: (g, x) => {
g.stopPropagation(), P(x);
},
textColor: "secondary",
indicatorColor: "secondary",
children: [
d && /* @__PURE__ */ n(
c,
{
value: "Command Line",
label: "Command Line"
/* COMMAND_LINE */
}
),
h && /* @__PURE__ */ n(
c,
{
value: "R",
label: "R"
/* R */
}
),
l && /* @__PURE__ */ n(
c,
{
value: "Python",
label: "Python"
/* PYTHON */
}
)
]
}
)
}
),
/* @__PURE__ */ e(u, { sx: { "& > p": { marginBottom: 3 } }, children: [
t === "Command Line" && /* @__PURE__ */ e(a, { children: [
/* @__PURE__ */ n(i, { variant: "body1", children: f }),
s,
/* @__PURE__ */ n("pre", { children: d })
] }),
t === "R" && /* @__PURE__ */ e(a, { children: [
/* @__PURE__ */ n(i, { variant: "body1", children: y }),
s,
/* @__PURE__ */ n("pre", { children: h })
] }),
t === "Python" && /* @__PURE__ */ e(a, { children: [
/* @__PURE__ */ n(i, { variant: "body1", children: v }),
s,
/* @__PURE__ */ n("pre", { children: l })
] })
] })
] }),
hasCancelButton: !1
}
);
};
export {
k as ProgrammaticInstructionsModal,
B as ProgrammaticOptionsTabs,
k as default
};
//# sourceMappingURL=ProgrammaticInstructionsModal.js.map