synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
57 lines (56 loc) • 1.68 kB
JavaScript
import { jsxs as l, jsx as r } from "react/jsx-runtime";
import { Box as d, Typography as p } from "@mui/material";
import { noop as f, times as g } from "lodash-es";
import { useEffect as q } from "react";
import { useGetActionsRequiredForTableQuery as A } from "../../synapse-queries/entity/useActionsRequiredForTableQuery.js";
import h from "../../utils/hooks/useTrackTransientListItems.js";
import { LoadingActionRequiredCard as x } from "./ActionRequiredCard/ActionRequiredCard.js";
import { ActionRequiredListItem as y } from "./ActionRequiredListItem.js";
function v(c) {
const {
queryBundleRequest: s,
columnModels: m,
onNumberOfRequiredActionsChanged: t = f,
onViewSharingSettingsClicked: a
} = c, { data: e, isLoading: i } = A(s, m, {
throwOnError: !0
}), n = h(
e
);
return q(() => {
e && t(e.length);
}, [e, t]), /* @__PURE__ */ l(
d,
{
sx: {
display: "flex",
flexDirection: "column",
gap: 3
},
children: [
!i && n.length === 0 && /* @__PURE__ */ r(
p,
{
variant: "body1Italic",
sx: { p: 4, textAlign: "center", color: "grey.700" },
children: "All requirements have been met. No actions are required."
}
),
n.map((o, u) => /* @__PURE__ */ r(
y,
{
action: o.action,
count: o.count,
onViewSharingSettingsClicked: a
},
u
)),
i && g(3).map((o) => /* @__PURE__ */ r(x, {}, o))
]
}
);
}
export {
v as TableQueryActionsRequired
};
//# sourceMappingURL=TableQueryActionsRequired.js.map