()
| 3 | import { ContentT } from '@/types/markdown'; |
| 4 | |
| 5 | export default async function DocPage() { |
| 6 | let content: ContentT; |
| 7 | |
| 8 | if (process.env.NODE_ENV === 'production') { |
| 9 | const data = await getDocsBySlug({ |
| 10 | section: 'docs', |
| 11 | slug: 'index' |
| 12 | }); |
| 13 | |
| 14 | content = data.content; |
| 15 | } else { |
| 16 | // dynamically import the file |
| 17 | const { getContentBySlugOnDev } = await import('@/lib/get-content-by-slug-on-dev'); |
| 18 | |
| 19 | const data = await getContentBySlugOnDev({ |
| 20 | type: 'docs', |
| 21 | slug: 'index', |
| 22 | section: 'docs', |
| 23 | }); |
| 24 | |
| 25 | content = data.content; |
| 26 | } |
| 27 | |
| 28 | return <Content content={content} />; |
| 29 | } |
nothing calls this directly
no test coverage detected