@stanfordspezi/spezi-web-design-system
Version:
Stanford Biodesign Digital Health Spezi Web Design System
34 lines (33 loc) • 1.05 kB
JavaScript
import { jsx as e } from "react/jsx-runtime";
import { E } from "./ErrorState-CVgGRS0u.mjs";
import { S } from "./Spinner-D_20zat4.mjs";
import { S as d } from "./StateContainer-D7lYvK4y.mjs";
import { E as x } from "./EmptyState-DBPSyIlu.mjs";
import { i as c, a as p } from "./isUndefined-DTeEysaY.mjs";
function m(r, t) {
const s = { ...r };
for (let o = 0; o < t.length; o++) {
const n = t[o];
delete s[n];
}
return s;
}
const A = (r) => c(r) ? {
show: !1
} : p(r) ? { show: r } : r, g = (r) => p(r) ? { show: r } : c(r) ? { show: !1 } : r, k = ({
entityName: r = "data",
empty: t,
error: s,
loading: o,
renderState: n,
children: l,
grow: u,
className: h,
padding: w
}) => {
const a = A(s), f = g(t), i = a.show ? /* @__PURE__ */ e(E, { entityName: r, ...m(a, ["show"]) }) : o ? /* @__PURE__ */ e(S, {}) : f.show ? /* @__PURE__ */ e(x, { entityName: r, ...m(f, ["show"]) }) : null;
return i ? n ? n(i) : /* @__PURE__ */ e(d, { grow: u, className: h, padding: w, children: i }) : l;
};
export {
k as A
};