MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / SingleDocPage

Function SingleDocPage

apps/baseai.dev/src/app/docs/[section]/page.tsx:7–43  ·  view source on GitHub ↗
({
	params
}: {
	params: Promise<{ section: string }>;
})

Source from the content-addressed store, hash-verified

5import { ContentT } from '@/types/markdown';
6
7export default async function SingleDocPage({
8 params
9}: {
10 params: Promise<{ section: string }>;
11}) {
12 const { section } = await params;
13 let content: ContentT;
14
15 if (process.env.NODE_ENV === 'production') {
16 const docContent = docsContent.find(
17 doc => doc.slug === section && doc.section === 'docs'
18 );
19
20 content = docContent?.content;
21 } else {
22 // dynamically import the file
23 const { getContentBySlugOnDev } = await import('@/lib/get-content-by-slug-on-dev');
24
25 let data = await getContentBySlugOnDev({
26 type: 'docs',
27 slug: section,
28 section: 'docs',
29 });
30
31 if (!data.content) {
32 data = await getContentBySlugOnDev({
33 type: 'docs',
34 slug: 'index',
35 section: section
36 });
37 }
38
39 content = data.content;
40 }
41
42 return <Content content={content} />;
43}

Callers

nothing calls this directly

Calls 1

getContentBySlugOnDevFunction · 0.85

Tested by

no test coverage detected