import { jsx, jsxs, Fragment } from "react/jsx-runtime";
import { Component, useEntity } from "@contember/react-binding";
import { EmptyStateContainer, Message } from "@contember/ui";
import { SearchX } from "lucide-react";
const NotFoundBoundary = Component(
  ({ children }) => {
    const accessor = useEntity();
    const node = accessor.environment.getSubTree();
    if (node.expectedCardinality === "one" && !accessor.existsOnServer) {
      return /* @__PURE__ */ jsx(EmptyStateContainer, { intent: "danger", header: /* @__PURE__ */ jsx(SearchX, {}), children: /* @__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
