synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
61 lines (60 loc) • 1.41 kB
JavaScript
import { jsxs as p, jsx as o } from "react/jsx-runtime";
import { useState as d } from "react";
import { Box as u, Typography as m } from "@mui/material";
import { AgentAccessLevel as t } from "@sage-bionetworks/synapse-types";
import x from "../DropdownSelect/DropdownSelect.js";
const l = [
{ value: t.PUBLICLY_ACCESSIBLE, label: "Public Data Only" },
{
value: t.READ_YOUR_PRIVATE_DATA,
label: "Read Your Private Data"
},
{
value: t.WRITE_YOUR_PRIVATE_DATA,
label: "Read & Write Your Data"
}
];
function D({
onChange: n,
initAccessLevel: s
}) {
const r = l.findIndex(
(e) => e.value == s
), i = l.map((e) => e.label), [a, c] = d(r);
return /* @__PURE__ */ p(
u,
{
sx: {
display: "flex",
justifyContent: "flex-end",
mt: "20px"
},
children: [
/* @__PURE__ */ o(
m,
{
variant: "label",
sx: { gridColumn: "2", mt: "10px", mr: "15px" },
children: "Access:"
}
),
/* @__PURE__ */ o(
x,
{
variant: "outlined",
options: i,
selectedIndex: a,
setSelectedIndex: (e) => {
a !== e && (c(e), n(l[e].value));
}
}
)
]
}
);
}
export {
D as AccessLevelMenu,
D as default
};
//# sourceMappingURL=AccessLevelMenu.js.map