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

130 lines (129 loc) 3.16 kB
import { jsxs as n, Fragment as d, jsx as e } from "react/jsx-runtime"; import { useGetEvaluation as f } from "../../synapse-queries/evaluation/useEvaluation.js"; import { Typography as t, Box as s, Skeleton as p, Alert as h, Link as x, IconButton as u } from "@mui/material"; import { ACCESS_TYPE as v } from "@sage-bionetworks/synapse-types"; import S from "../EvaluationFinder/EvaluationFinder.js"; import g from "../IconSvg/IconSvg.js"; function b(l) { const { evaluationId: o, onRemove: i } = l, { data: r, isLoading: a, isError: c, error: m } = f(o); return a ? /* @__PURE__ */ e(p, { width: "100%" }) : c ? /* @__PURE__ */ n(h, { severity: "error", children: [ /* @__PURE__ */ e(t, { children: m.reason }), /* @__PURE__ */ e( x, { onClick: (y) => { i(); }, children: "Remove from scope" } ) ] }) : /* @__PURE__ */ n( s, { sx: { display: "flex", flexDirection: "row", gap: 1, alignItems: "center", justifyContent: "space-between" }, children: [ /* @__PURE__ */ e(t, { variant: "smallText1", children: r.name }, r.id), /* @__PURE__ */ e( u, { size: "small", "aria-label": `Remove ${r.name} from scope`, onClick: () => { i(); }, sx: { "&:hover": { color: "error.main" } }, children: /* @__PURE__ */ e(g, { icon: "delete", fontSize: "inherit", wrap: !1 }) } ) ] } ); } function k(l) { const { evaluationIds: o = [], onChange: i } = l; return /* @__PURE__ */ n(d, { children: [ /* @__PURE__ */ e( t, { variant: "smallText1", sx: { mb: 1, fontWeight: 700 }, children: "Evaluations" } ), /* @__PURE__ */ e( S, { activeOnly: !1, accessType: v.READ_PRIVATE_SUBMISSION, selectedIds: o, onChange: i } ), /* @__PURE__ */ n( s, { sx: { p: 2.5, mb: 2.5, border: "1px solid", borderColor: "grey.300" }, children: [ /* @__PURE__ */ e( t, { variant: "smallText1", sx: { mb: 1, fontWeight: 700 }, children: "Selected" } ), /* @__PURE__ */ e( s, { sx: { display: "flex", flexDirection: "column", gap: 1 }, children: o.map((r) => /* @__PURE__ */ e( b, { evaluationId: r, onRemove: () => { i(o.filter((a) => a !== r)); } }, r )) } ) ] } ) ] }); } export { k as default }; //# sourceMappingURL=SubmissionViewScopeEditor.js.map