2024-01-15 12:33:15 +00:00
|
|
|
import { Article } from '@/types/content-types'
|
|
|
|
import { getDb } from '@/utils/ContentDatabase'
|
2024-01-17 10:10:44 +00:00
|
|
|
import { ArticleDetails } from './ArticleDetails'
|
2024-02-29 16:28:45 +00:00
|
|
|
import { ArticleHeadingLinks } from './ArticleHeadingLinks'
|
2024-01-15 12:33:15 +00:00
|
|
|
import { ArticleNavLinks } from './ArticleNavLinks'
|
|
|
|
import { Header } from './Header'
|
|
|
|
import { Mdx } from './Mdx'
|
|
|
|
import { Sidebar } from './Sidebar'
|
|
|
|
import { Image } from './mdx-components/generic'
|
|
|
|
|
|
|
|
export async function ArticleDocsPage({ article }: { article: Article }) {
|
|
|
|
const db = await getDb()
|
|
|
|
const section = await db.getSection(article.sectionId)
|
|
|
|
const category = await db.getCategory(article.categoryId)
|
|
|
|
const headings = await db.getArticleHeadings(article.id)
|
|
|
|
const links = await db.getArticleLinks(article)
|
|
|
|
const sidebar = await db.getSidebarContentList({
|
|
|
|
sectionId: section.id,
|
|
|
|
categoryId: category.id,
|
|
|
|
articleId: article.id,
|
|
|
|
})
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2024-01-30 14:19:25 +00:00
|
|
|
<Header sectionId={section.id} />
|
2024-02-29 16:28:45 +00:00
|
|
|
<Sidebar {...sidebar} />
|
|
|
|
<main className="main-content article">
|
2024-01-15 12:33:15 +00:00
|
|
|
<div className="page-header">
|
|
|
|
<h1>{article.title}</h1>
|
|
|
|
</div>
|
|
|
|
{article.hero && <Image alt="hero" title={article.title} src={`images/${article.hero}`} />}
|
|
|
|
{article.content && <Mdx content={article.content} />}
|
2024-02-29 16:28:45 +00:00
|
|
|
<ArticleDetails article={article} />
|
2024-01-15 12:33:15 +00:00
|
|
|
{links && <ArticleNavLinks links={links} />}
|
|
|
|
</main>
|
2024-02-29 16:28:45 +00:00
|
|
|
<ArticleHeadingLinks article={article} headingLinks={headings} />
|
2024-01-15 12:33:15 +00:00
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|