import _Button from "@alifd/next/es/button";
import React, { useState } from "react";
import { JSONSetter } from "./jsonSetter";
import { t } from "../../../src/locale";
export var FakeRender = function FakeRender(props) {
  var _useState = useState(props.value),
    value = _useState[0],
    setValue = _useState[1];
  function onChange(value) {
    setValue(value);
  }
  function saveChange() {
    props.onChange(value);
  }
  return /*#__PURE__*/React.createElement("div", {
    className: "fakeRender_box"
  }, /*#__PURE__*/React.createElement(JSONSetter, {
    value: JSON.stringify(value),
    onChange: onChange
  }), /*#__PURE__*/React.createElement(_Button, {
    onClick: saveChange
  }, t("setter.save")));
};