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

56 lines (55 loc) 1.51 kB
import { jsxs as o, Fragment as s, jsx as t } from "react/jsx-runtime"; import { useState as i } from "react"; import { Typography as x, Box as m } from "@mui/material"; import c from "../../ExpandCollapseButton.js"; import { chromeLight as d, Inspector as f } from "react-inspector"; function y(a) { const { value: l } = a, [e, n] = i(!1), r = { ...d, BASE_BACKGROUND_COLOR: "none" }; return /* @__PURE__ */ o(s, { children: [ /* @__PURE__ */ o( x, { variant: "smallText1", sx: { py: 0.5, color: "grey.600", fontStyle: "italic", cursor: "pointer" }, onClick: () => n((p) => !p), children: [ e ? "Collapse" : "Expand", " all", /* @__PURE__ */ t( c, { className: "ExpandableTableData__expandButton", isExpanded: e } ) ] } ), /* @__PURE__ */ t(m, { sx: { pl: "2px" }, children: /* @__PURE__ */ t( f, { data: l, theme: r, table: !1, expandLevel: e ? ( // making this number very large actually results in a performance hit, so choose a reasonably small number 20 ) : 0 }, // Setting `expandLevel` to 0 doesn't trigger a re-render, so force the rerender by updating the key String(e) ) }) ] }); } export { y as ComplexJSONRenderer }; //# sourceMappingURL=ComplexJSONRenderer.js.map