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

39 lines (38 loc) 1.22 kB
import { jsx as n, jsxs as o } from "react/jsx-runtime"; import { Collapse as s, Box as d } from "@mui/material"; function c(r) { if (Array.isArray(r) || typeof r == "boolean") return "unknown"; const { type: e, enum: t } = r; return e === "array" && typeof r.items == "object" ? `List of ${c(r.items)}` : t ? "enumeration" : Array.isArray(e) ? e.reduce( (i, l) => `${i}, ${l}`, "" ) : e || "unknown"; } function a(r) { const { description: e, schema: t } = r, i = c(t); return /* @__PURE__ */ n(s, { className: "field-description", in: !0, children: /* @__PURE__ */ n( d, { component: "table", className: "FieldDescriptionTable", sx: { mb: 1 }, children: /* @__PURE__ */ o("tbody", { children: [ e && /* @__PURE__ */ o("tr", { children: [ /* @__PURE__ */ n("th", { children: "Description" }), /* @__PURE__ */ n("td", { children: e }) ] }), /* @__PURE__ */ o("tr", { children: [ /* @__PURE__ */ n("th", { children: "Type" }), /* @__PURE__ */ n("td", { children: i }) ] }) ] }) } ) }); } export { a as default }; //# sourceMappingURL=FieldDescriptionTable.js.map