import { jsx } from "react/jsx-runtime";
import { DataBindingProvider, EntitySubTree } from "@contember/react-binding";
import { useOnPersistSuccess } from "../useOnPersistSuccess.js";
import { NotFoundBoundary } from "./NotFoundBoundary.js";
import { scopeComponent } from "./scopeComponent.js";
import { FeedbackRenderer } from "../../bindingFacade/renderers/FeedbackRenderer.js";
const EditScope = scopeComponent(
  ({
    children,
    onPersistSuccess,
    redirectOnSuccess,
    refreshDataBindingOnPersist,
    skipBindingStateUpdateAfterPersist,
    stateComponent,
    stateProps,
    ...entityProps
  }) => /* @__PURE__ */ jsx(
    DataBindingProvider,
    {
      refreshOnPersist: refreshDataBindingOnPersist ?? true,
      stateComponent: stateComponent ?? FeedbackRenderer,
      stateProps,
      skipStateUpdateAfterPersist: skipBindingStateUpdateAfterPersist,
      children: /* @__PURE__ */ jsx(EntitySubTree, { ...entityProps, onPersistSuccess: useOnPersistSuccess({ redirectOnSuccess, onPersistSuccess }), children: /* @__PURE__ */ jsx(NotFoundBoundary, { children }) })
    }
  ),
  "EditScope"
);
export {
  EditScope
};
//# sourceMappingURL=EditScope.js.map
