synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
43 lines (42 loc) • 938 B
JavaScript
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