import { jsxDEV } from "react/jsx-dev-runtime";
import { Component, EntitySubTree } from "@contember/binding";
import { AutoFields } from "./AutoFields.js";
import { NotFoundWrapper } from "../pageRouting/pageComponents/NotFoundWrapper.js";
const AutoForm = Component(
  ({ entity, id, onCreateSuccess, createEditLink }) => {
    if (id === void 0) {
      return /* @__PURE__ */ jsxDEV(EntitySubTree, { entity, isCreating: true, onPersistSuccess: onCreateSuccess, children: /* @__PURE__ */ jsxDEV(AutoFields, { createEditLink }, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/components/Auto/AutoForm.tsx",
        lineNumber: 22,
        columnNumber: 6
      }, globalThis) }, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/components/Auto/AutoForm.tsx",
        lineNumber: 21,
        columnNumber: 5
      }, globalThis);
    } else {
      return /* @__PURE__ */ jsxDEV(EntitySubTree, { entity: { entityName: entity, where: { id } }, children: /* @__PURE__ */ jsxDEV(NotFoundWrapper, { children: /* @__PURE__ */ jsxDEV(AutoFields, { createEditLink }, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/components/Auto/AutoForm.tsx",
        lineNumber: 30,
        columnNumber: 7
      }, globalThis) }, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/components/Auto/AutoForm.tsx",
        lineNumber: 29,
        columnNumber: 6
      }, globalThis) }, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/components/Auto/AutoForm.tsx",
        lineNumber: 28,
        columnNumber: 5
      }, globalThis);
    }
  }
);
export {
  AutoForm
};
//# sourceMappingURL=AutoForm.js.map
