import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
import { Component, useEntity } from "@contember/binding";
import { LayoutPage, Message } from "@contember/ui";
const NotFoundWrapper = Component(
  ({ children, title }) => {
    const accessor = useEntity();
    const node = accessor.environment.getSubTree();
    if (node.expectedCardinality === "one" && !accessor.existsOnServer) {
      return /* @__PURE__ */ jsxDEV(LayoutPage, { title, children: /* @__PURE__ */ jsxDEV(Message, { intent: "danger", children: [
        "Requested entity of type ",
        accessor.name,
        " was not found"
      ] }, void 0, true, {
        fileName: "/__w/interface/interface/packages/admin/src/components/pageRouting/pageComponents/NotFoundWrapper.tsx",
        lineNumber: 12,
        columnNumber: 6
      }, globalThis) }, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/components/pageRouting/pageComponents/NotFoundWrapper.tsx",
        lineNumber: 11,
        columnNumber: 5
      }, globalThis);
    }
    return /* @__PURE__ */ jsxDEV(Fragment, { children }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/pageRouting/pageComponents/NotFoundWrapper.tsx",
      lineNumber: 16,
      columnNumber: 10
    }, globalThis);
  },
  ({ children }) => /* @__PURE__ */ jsxDEV(Fragment, { children }, void 0, false, {
    fileName: "/__w/interface/interface/packages/admin/src/components/pageRouting/pageComponents/NotFoundWrapper.tsx",
    lineNumber: 18,
    columnNumber: 20
  }, globalThis)
);
export {
  NotFoundWrapper
};
//# sourceMappingURL=NotFoundWrapper.js.map
