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

59 lines (58 loc) 1.5 kB
import { jsxs as u, jsx as n } from "react/jsx-runtime"; import { Box as f, Typography as l } from "@mui/material"; import { RestrictableObjectType as s } from "@sage-bionetworks/synapse-types"; import { uniqWith as T, isEqual as E } from "lodash-es"; import { useMemo as b } from "react"; import { EntityHeaderTable as x } from "../EntityHeaderTable/EntityHeaderTable.js"; const y = "Mark for Removal from AR", j = "No entities selected."; function O(c) { const { subjects: r, onUpdate: t, onUpdateEntityIDsTextbox: i } = c, o = b(() => r.filter((e) => e.type === s.ENTITY).map((e) => ({ targetId: e.id })), [r]), a = (e) => { if (t) { const m = T(e, E).map((p) => ({ id: p.targetId, type: s.ENTITY })); t(m); } }; return /* @__PURE__ */ u( f, { sx: { mb: 2 }, children: [ o.length === 0 && /* @__PURE__ */ n( l, { variant: "body1Italic", sx: { mb: -4 }, children: j } ), /* @__PURE__ */ n( x, { references: o, isEditable: !!t, onUpdate: (e) => { a(e); }, removeSelectedRowsButtonText: y, onUpdateEntityIDsTextbox: i } ) ] } ); } export { j as NO_ENTITIES_SELECTED, y as REMOVE_BUTTON_TEXT, O as default }; //# sourceMappingURL=EntitySubjectsSelector.js.map