import { Component, useEntity } from "@contember/binding";
import { LayoutPage, Message } from "@contember/ui";
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
var _jsxFileName = "/__w/interface/interface/packages/admin/src/components/pageRouting/pageComponents/NotFoundWrapper.tsx";
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: _jsxFileName,
        lineNumber: 12,
        columnNumber: 6
      }, void 0)
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 11,
      columnNumber: 5
    }, void 0);
  }
  return /* @__PURE__ */ jsxDEV(Fragment, {
    children
  }, void 0, false);
}, ({
  children
}) => /* @__PURE__ */ jsxDEV(Fragment, {
  children
}, void 0, false));
export {
  NotFoundWrapper
};
//# sourceMappingURL=NotFoundWrapper.js.map
