import { jsx, jsxs } from "react/jsx-runtime";
import { getApiDocsResources, resolveApiDocsBaseUrl } from "@open-mercato/core/modules/api_docs/lib/resources";
async function ApiDocsPage() {
  const baseUrl = resolveApiDocsBaseUrl();
  const resources = getApiDocsResources();
  return /* @__PURE__ */ jsxs("div", { className: "space-y-8", children: [
    /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
      /* @__PURE__ */ jsx("h1", { className: "text-2xl font-semibold", children: "API resources" }),
      /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground max-w-3xl", children: "Use the links below to explore the Open Mercato platform APIs. The OpenAPI exports are generated from the current module registry." })
    ] }),
    /* @__PURE__ */ jsx("div", { className: "grid gap-4 md:grid-cols-2", children: resources.map((resource) => /* @__PURE__ */ jsxs("div", { className: "rounded border bg-card p-4 h-full flex flex-col justify-between", children: [
      /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
        /* @__PURE__ */ jsx("div", { className: "text-base font-semibold", children: resource.label }),
        /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: resource.description })
      ] }),
      /* @__PURE__ */ jsx("div", { className: "pt-4", children: /* @__PURE__ */ jsx(
        "a",
        {
          href: resource.href,
          target: resource.external ? "_blank" : void 0,
          rel: resource.external ? "noreferrer" : void 0,
          className: "inline-flex items-center text-sm font-medium text-primary hover:underline",
          children: resource.actionLabel ?? (resource.external ? "Open docs" : "Open link")
        }
      ) })
    ] }, resource.href)) }),
    /* @__PURE__ */ jsxs("div", { className: "rounded border bg-muted/30 p-4 text-sm text-muted-foreground space-y-2", children: [
      /* @__PURE__ */ jsxs("p", { children: [
        "Current environment base URL:",
        " ",
        /* @__PURE__ */ jsx("code", { className: "rounded bg-background px-2 py-0.5 text-xs text-foreground", children: baseUrl })
      ] }),
      /* @__PURE__ */ jsxs("p", { children: [
        "Run ",
        /* @__PURE__ */ jsx("code", { className: "rounded bg-background px-2 py-0.5 text-xs text-foreground", children: "yarn generate" }),
        " ",
        "whenever APIs change to refresh the generated registry."
      ] })
    ] })
  ] });
}
export {
  ApiDocsPage as default
};
//# sourceMappingURL=page.js.map
