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

45 lines (44 loc) 1.52 kB
import { jsx as e, jsxs as l, Fragment as d } from "react/jsx-runtime"; import { useState as c } from "react"; import { Typography as t, Collapse as x, Box as h } from "@mui/material"; import { JSONPrimitiveRenderer as n } from "./JSONPrimitiveRenderer.js"; import f from "../../ExpandCollapseButton.js"; function S(i) { const { value: a } = i, [r, o] = c(!1), s = a.length > 1; return a.length === 0 ? /* @__PURE__ */ e(t, { variant: "smallText1", className: "SRC-inactive", children: "Empty array" }) : a.length === 1 ? /* @__PURE__ */ e(t, { variant: "smallText1", children: /* @__PURE__ */ e(n, { value: a[0] }) }) : /* @__PURE__ */ l(d, { children: [ s && /* @__PURE__ */ l( t, { variant: "smallText1", sx: { color: "grey.600", fontStyle: "italic", mb: 1 }, children: [ `${a.length.toLocaleString()} items`, /* @__PURE__ */ e( f, { isExpanded: r, className: "ExpandableTableData__expandButton", onClick: () => o(!r) } ) ] } ), /* @__PURE__ */ e(x, { in: r, children: a.map((m, p) => /* @__PURE__ */ e( h, { sx: { display: "flex", gap: 0.5, mb: 1 }, children: /* @__PURE__ */ e(t, { variant: "smallText1", children: /* @__PURE__ */ e(n, { value: m }) }) }, p )) }) ] }); } export { S as JSONArrayRenderer }; //# sourceMappingURL=JSONArrayRenderer.js.map