synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
91 lines (90 loc) • 3.21 kB
JavaScript
import { jsx as l, Fragment as c } from "react/jsx-runtime";
import { getIsAllSelectedFromInfiniteList as o } from "../../../utils/hooks/useGetIsAllSelectedInfiniteList.js";
import { useState as E } from "react";
import t from "use-deep-compare-effect";
import { SynapseErrorBoundary as I } from "../../error/ErrorBanner.js";
import { EntityChildrenDetails as A } from "./configurations/EntityChildrenDetails.js";
import { FavoritesDetails as s } from "./configurations/FavoritesDetails.js";
import { ProjectListDetails as N } from "./configurations/ProjectListDetails.js";
import { ReferenceDetails as _ } from "./configurations/ReferenceDetails.js";
import { SearchDetails as d } from "./configurations/SearchDetails.js";
import { DetailsView as R } from "./view/DetailsView.js";
var F = /* @__PURE__ */ ((e) => (e[e.REFERENCE_LIST = 0] = "REFERENCE_LIST", e[e.HEADER_LIST = 1] = "HEADER_LIST", e[e.PARENT_CONTAINER = 2] = "PARENT_CONTAINER", e[e.USER_PROJECTS = 3] = "USER_PROJECTS", e[e.USER_FAVORITES = 4] = "USER_FAVORITES", e[e.ENTITY_SEARCH = 5] = "ENTITY_SEARCH", e[e.PROMPT = 6] = "PROMPT", e))(F || {});
function H({
configuration: e,
...r
}) {
const [S, n] = E(/* @__PURE__ */ l(c, {}));
return t(() => {
n(((m) => {
switch (m.type) {
case 2:
return /* @__PURE__ */ l(
A,
{
parentContainerId: m.parentContainerId,
...r
}
);
case 1:
return /* @__PURE__ */ l(
R,
{
entities: m.headerList,
isLoading: !1,
hasNextPage: !1,
...r,
enableSelectAll: r.enableSelectAll,
selectAllIsChecked: o(
m.headerList ?? [],
r.selected.size,
r.isIdSelected,
r.isSelectable
)
}
);
case 0:
return /* @__PURE__ */ l(
_,
{
...r,
references: m.referenceList
}
);
case 4:
return /* @__PURE__ */ l(s, { ...r });
case 5:
return /* @__PURE__ */ l(d, { searchQuery: m.query, ...r });
case 3:
return /* @__PURE__ */ l(
N,
{
projectsParams: m.getProjectParams,
...r
}
);
case 6:
return /* @__PURE__ */ l(
R,
{
entities: [],
isLoading: !1,
noResultsPlaceholder: /* @__PURE__ */ l("div", { children: "Use the left panel to browse Synapse, then make a selection in this panel" }),
...r,
enableSelectAll: !1
}
);
default:
return console.warn(
"The configuration type does not map to a known view type. No Details view will be rendered. Invalid configuration: ",
m
), /* @__PURE__ */ l(c, {});
}
})(e));
}, [e, r]), /* @__PURE__ */ l(I, { children: S });
}
export {
H as EntityDetailsList,
F as EntityDetailsListDataConfigurationType
};
//# sourceMappingURL=EntityDetailsList.js.map