-
-
Save brunosabot/dd0de643a61b47668b47debf6858feb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { MDXProvider } from "@mdx-js/react"; | |
import { MDXRemoteSerializeResult } from "next-mdx-remote"; | |
import { MDXRemote } from "next-mdx-remote"; | |
/* getStaticProps method here */ | |
interface IBlogPost { | |
creator: string; | |
date: string; | |
lang: string; | |
path: string; | |
title: string; | |
} | |
interface IBlogProps { | |
post: IBlogPost; | |
source: MDXRemoteSerializeResult<Record<string, unknown>>; | |
} | |
const components = {}; | |
const Blog: React.FC<IBlogProps> = ({ source, post }) => { | |
return ( | |
<MDXProvider components={components}> | |
<article> | |
<h1>{post.title}</h1> | |
<h2> | |
By {post.creator} on {post.date} | |
</h2> | |
<MDXRemote {...source} /> | |
</article> | |
</MDXProvider> | |
); | |
}; | |
export default Blog; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment