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

82 lines (81 loc) 2.64 kB
import { jsx as i, jsxs as r, Fragment as w } from "react/jsx-runtime"; import { useState as C, Suspense as d } from "react"; import { CardContainer as L } from "../CardContainer/CardContainer.js"; import { SynapseTable as b } from "../SynapseTable/SynapseTable.js"; import I from "./LastUpdatedOn.js"; import { useDeepCompareMemoize as N } from "use-deep-compare-effect"; import g from "../QueryWrapper/QueryWrapperLoadingScreen.js"; import { SynapseErrorBoundary as P } from "../error/ErrorBanner.js"; import { useQueryContext as y } from "../QueryContext/QueryContext.js"; import { Box as v } from "@mui/material"; import { TablePagination as R } from "../SynapseTable/TablePagination.js"; import { ViewMoreQueryResultsButton as D } from "../QueryWrapper/ViewMoreQueryResultsButton.js"; import { useRowSet as A } from "./UseRowSet.js"; function q(e) { const { cardConfiguration: n, hideDownload: u, initialLimit: t, multiCardList: c } = e, [a, h] = C( t != null ), { isInfinite: m } = y(), s = N( e.tableConfiguration ? { ...e.tableConfiguration, hideDownload: u } : void 0 ), { rowSet: o, progressMessage: f, isLoading: l, isLoadingNewPage: p, fetchNextPageOfInfiniteData: x, hasNextPageOfInfiniteData: S } = A(a ? t : void 0); return /* @__PURE__ */ i(P, { children: /* @__PURE__ */ r("div", { className: "RowSetView", children: [ l && /* @__PURE__ */ i(g, { progressMessage: f }), !l && o && // even after the rowSet is loaded, a child component may suspend /* @__PURE__ */ r( d, { fallback: /* @__PURE__ */ i(g, { progressMessage: f }), children: [ s && /* @__PURE__ */ i( b, { ...s, rowSet: o, isLoadingNewPage: p } ), n && /* @__PURE__ */ i( L, { ...n, rowSet: o, multiCardList: c } ) ] } ), /* @__PURE__ */ r(d, { fallback: /* @__PURE__ */ i(w, {}), children: [ !m && /* @__PURE__ */ i(v, { sx: { mt: 2, textAlign: "right" }, children: /* @__PURE__ */ i(R, {}) }), m && /* @__PURE__ */ i( D, { initialLimit: t, initialLimitIsApplied: a, onRemoveInitialLimit: () => { h(!1); }, fetchNextPage: () => { x(); }, hasNextPage: S, isFetchingNextPage: p } ) ] }), /* @__PURE__ */ i(I, {}) ] }) }); } export { q as RowSetView }; //# sourceMappingURL=RowSetView.js.map