refactor: use MDXLayoutRenderer component
This commit is contained in:
parent
8914349256
commit
900669acfd
@ -1,6 +1,4 @@
|
||||
import { MDXRemote } from 'next-mdx-remote'
|
||||
import { MDXComponents } from '@/components/MDXComponents'
|
||||
import AuthorLayout from '@/layouts/AuthorLayout'
|
||||
import { MDXLayoutRenderer } from '@/components/MDXComponents'
|
||||
import { getFileBySlug } from '@/lib/mdx'
|
||||
|
||||
export async function getStaticProps() {
|
||||
@ -12,8 +10,10 @@ export default function About({ authorDetails }) {
|
||||
const { mdxSource, frontMatter } = authorDetails
|
||||
|
||||
return (
|
||||
<AuthorLayout frontMatter={frontMatter}>
|
||||
<MDXRemote {...mdxSource} components={MDXComponents} />
|
||||
</AuthorLayout>
|
||||
<MDXLayoutRenderer
|
||||
layout={frontMatter.layout || 'AuthorLayout'}
|
||||
mdxSource={mdxSource}
|
||||
frontMatter={frontMatter}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user