UNPKG

@stanfordspezi/spezi-web-design-system

Version:

Stanford Biodesign Digital Health Spezi Web Design System

39 lines (38 loc) 1.07 kB
import { jsx as e } from "react/jsx-runtime"; import { E as w } from "./ErrorState-CbL7oTXp.mjs"; import { S as d } from "./Spinner-DdtN8GcD.mjs"; import { S as E } from "./StateContainer-D7lYvK4y.mjs"; import { E as S } from "./EmptyState-D6pGMxOA.mjs"; function u(t, r) { const n = { ...t }; for (let o = 0; o < r.length; o++) { const s = r[o]; delete n[s]; } return n; } function c(t) { return typeof t == "boolean"; } function l(t) { return t === void 0; } const x = (t) => l(t) ? { show: !1 } : c(t) ? { show: t } : t, y = (t) => c(t) ? { show: t } : l(t) ? { show: !1 } : t, C = ({ entityName: t = "data", empty: r, error: n, loading: o, renderState: s, children: p, grow: m, className: h }) => { const a = x(n), f = y(r), i = a.show ? /* @__PURE__ */ e(w, { entityName: t, ...u(a, ["show"]) }) : o ? /* @__PURE__ */ e(d, {}) : f.show ? /* @__PURE__ */ e(S, { entityName: t, ...u(f, ["show"]) }) : null; return i ? s ? s(i) : /* @__PURE__ */ e(E, { grow: m, className: h, children: i }) : p; }; export { C as A, c as i };