// src/components/docs/getting-started/TroubleshootingPage.tsx
import Link from "@contractspec/lib.ui-link";
import { ChevronRight } from "lucide-react";
import { CodeBlock } from "@contractspec/lib.design-system";
import { jsx, jsxs } from "react/jsx-runtime";
function TroubleshootingPage() {
  return /* @__PURE__ */ jsxs("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-2",
        children: [
          /* @__PURE__ */ jsx("h1", {
            className: "text-4xl font-bold",
            children: "Troubleshooting"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground text-lg",
            children: "Common issues and fixes when installing or generating with ContractSpec."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-6",
        children: [
          /* @__PURE__ */ jsxs("div", {
            className: "card-subtle space-y-3 p-6",
            children: [
              /* @__PURE__ */ jsx("h2", {
                className: "text-2xl font-bold",
                children: "Command not found"
              }),
              /* @__PURE__ */ jsxs("ul", {
                className: "text-muted-foreground space-y-2",
                children: [
                  /* @__PURE__ */ jsx("li", {
                    children: "Reinstall the CLI and ensure it is in your PATH."
                  }),
                  /* @__PURE__ */ jsx("li", {
                    children: "Confirm Node.js 20+ or Bun 1.0+ is installed."
                  })
                ]
              })
            ]
          }),
          /* @__PURE__ */ jsxs("div", {
            className: "card-subtle space-y-3 p-6",
            children: [
              /* @__PURE__ */ jsx("h2", {
                className: "text-2xl font-bold",
                children: "Specs not discovered"
              }),
              /* @__PURE__ */ jsxs("ul", {
                className: "text-muted-foreground space-y-2",
                children: [
                  /* @__PURE__ */ jsxs("li", {
                    children: [
                      "Run ",
                      /* @__PURE__ */ jsx("code", {
                        children: "contractspec list"
                      }),
                      " to see discovered specs."
                    ]
                  }),
                  /* @__PURE__ */ jsx("li", {
                    children: "Verify your spec path conventions in .contractsrc.json."
                  })
                ]
              })
            ]
          }),
          /* @__PURE__ */ jsxs("div", {
            className: "card-subtle space-y-3 p-6",
            children: [
              /* @__PURE__ */ jsx("h2", {
                className: "text-2xl font-bold",
                children: "Build or validate fails"
              }),
              /* @__PURE__ */ jsxs("ul", {
                className: "text-muted-foreground space-y-2",
                children: [
                  /* @__PURE__ */ jsxs("li", {
                    children: [
                      "Run ",
                      /* @__PURE__ */ jsx("code", {
                        children: "contractspec validate"
                      }),
                      " to surface schema errors."
                    ]
                  }),
                  /* @__PURE__ */ jsx("li", {
                    children: "Check that generated files were not manually edited."
                  })
                ]
              })
            ]
          }),
          /* @__PURE__ */ jsxs("div", {
            className: "space-y-3",
            children: [
              /* @__PURE__ */ jsx("h2", {
                className: "text-2xl font-bold",
                children: "Diagnostics"
              }),
              /* @__PURE__ */ jsx(CodeBlock, {
                language: "bash",
                filename: "troubleshooting-diagnostics",
                code: `contractspec --version
contractspec list
contractspec validate src/contracts/mySpec.ts`
              })
            ]
          }),
          /* @__PURE__ */ jsxs("div", {
            className: "card-subtle space-y-3 p-6",
            children: [
              /* @__PURE__ */ jsx("h2", {
                className: "text-2xl font-bold",
                children: "Still blocked?"
              }),
              /* @__PURE__ */ jsxs("ul", {
                className: "text-muted-foreground space-y-2",
                children: [
                  /* @__PURE__ */ jsx("li", {
                    children: "Confirm compatibility requirements for runtime and framework."
                  }),
                  /* @__PURE__ */ jsx("li", {
                    children: "Re-run builds on a clean branch to isolate changes."
                  }),
                  /* @__PURE__ */ jsx("li", {
                    children: "Use a new spec and minimal adapter to validate setup."
                  })
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "flex flex-wrap items-center gap-3 pt-2",
        children: [
          /* @__PURE__ */ jsx(Link, {
            href: "/docs/getting-started/start-here",
            className: "btn-ghost",
            children: "Start here"
          }),
          /* @__PURE__ */ jsx(Link, {
            href: "/docs/getting-started/compatibility",
            className: "btn-ghost",
            children: "Compatibility"
          }),
          /* @__PURE__ */ jsxs(Link, {
            href: "/docs/getting-started/installation",
            className: "btn-primary",
            children: [
              "Next: Installation ",
              /* @__PURE__ */ jsx(ChevronRight, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}
export {
  TroubleshootingPage
};
