import { jsxs, jsx, Fragment } from "react/jsx-runtime";
import { Component, useEntity } from "@contember/binding";
import { Message } from "@contember/ui";
const NotFoundBoundary = Component(
  ({ children }) => {
    const accessor = useEntity();
    const node = accessor.environment.getSubTree();
    if (node.expectedCardinality === "one" && !accessor.existsOnServer) {
      return /* @__PURE__ */ jsxs(Message, { intent: "danger", children: [
        "Requested entity of type ",
        accessor.name,
        " was not found"
      ] });
    } else {
      return /* @__PURE__ */ jsx(Fragment, { children });
    }
  },
  ({ children }) => /* @__PURE__ */ jsx(Fragment, { children })
);
export {
  NotFoundBoundary
};
//# sourceMappingURL=NotFoundBoundary.js.map
