import { jsx } from "react/jsx-runtime";
import { DataBindingProvider, EntitySubTree } from "@contember/react-binding";
import { useOnPersistSuccess } from "../useOnPersistSuccess.js";
import { pageComponent } from "./pageComponent.js";
import { LayoutRenderer } from "../../bindingFacade/renderers/LayoutRenderer.js";
import { FeedbackRenderer } from "../../bindingFacade/renderers/FeedbackRenderer.js";
import { PersistButton } from "../../bindingFacade/buttons/PersistButton.js";
const CreatePage = pageComponent(
  ({ pageName, children, rendererProps, redirectOnSuccess, onPersistSuccess, ...entityProps }) => {
    return /* @__PURE__ */ jsx(DataBindingProvider, { stateComponent: FeedbackRenderer, children: /* @__PURE__ */ jsx(EntitySubTree, { ...entityProps, onPersistSuccess: useOnPersistSuccess({ redirectOnSuccess, onPersistSuccess }), isCreating: true, children: /* @__PURE__ */ jsx(LayoutRenderer, { ...rendererProps, actions: rendererProps?.actions ?? /* @__PURE__ */ jsx(PersistButton, {}), children }) }) });
  },
  "CreatePage"
);
export {
  CreatePage
};
//# sourceMappingURL=CreatePage.js.map
