diff --git a/apps/web/src/app/docs/[id]/page.tsx b/apps/web/src/app/docs/[id]/page.tsx new file mode 100644 index 0000000..2601358 --- /dev/null +++ b/apps/web/src/app/docs/[id]/page.tsx @@ -0,0 +1,54 @@ +import type { GeneratedDocs } from "@codeboard/shared"; +import { notFound } from "next/navigation"; +import { Github, ArrowLeft } from "lucide-react"; +import Link from "next/link"; + +async function fetchDocs(id: string): Promise { + try { + const baseUrl = process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000"; + const response = await fetch(`${baseUrl}/api/docs/${id}`, { + cache: "no-store", + }); + + if (!response.ok) { + return null; + } + + return response.json(); + } catch { + return null; + } +} + +export default async function DocsPage({ + params, +}: { + params: { id: string }; +}) { + const docs = await fetchDocs(params.id); + + if (!docs) { + notFound(); + } + + return ( +
+
+
+
+

+ Analyzing Repository +

+

+ {docs.repoName || repoUrl || "Unknown repository"} +

+
+ +
+ +
+
+
+
+ ); +}