"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const reactBinding = require("@contember/react-binding");
const ui = require("@contember/ui");
const lucideReact = require("lucide-react");
const NotFoundBoundary = reactBinding.Component(
  ({ children }) => {
    const accessor = reactBinding.useEntity();
    const node = accessor.environment.getSubTree();
    if (node.expectedCardinality === "one" && !accessor.existsOnServer) {
      return /* @__PURE__ */ jsxRuntime.jsx(ui.EmptyStateContainer, { intent: "danger", header: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchX, {}), children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Message, { intent: "danger", children: [
        "Requested entity of type ",
        accessor.name,
        " was not found"
      ] }) });
    } else {
      return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
    }
  },
  ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children })
);
exports.NotFoundBoundary = NotFoundBoundary;
//# sourceMappingURL=NotFoundBoundary.cjs.map
