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

43 lines (42 loc) 938 B
import { jsx as r } from "react/jsx-runtime"; import { useRef as d, useState as c, useEffect as p } from "react"; import { ConfirmationDialog as S } from "../ConfirmationDialog/ConfirmationDialog.js"; import C from "./JSONArrayEditor.js"; function V(n) { const { isShowingModal: i, onConfirm: m, onCancel: a, dialogTitle: u = "Edit Values", value: o, ...f } = n, t = d(null), [l, e] = c(o ?? []); return p(() => { o && e(o); }, [o]), /* @__PURE__ */ r( S, { open: i, title: u, onCancel: a, maxWidth: "md", content: /* @__PURE__ */ r( C, { formRef: t, value: l, onChange: (s) => e(s), onSubmit: m, ...f } ), onConfirm: () => { t.current.formElement.current.requestSubmit(); } } ); } export { V as default }; //# sourceMappingURL=JSONArrayEditorModal.js.map