implemented file upload for attachments
This commit is contained in:
@@ -1,17 +1,42 @@
|
||||
|
||||
import Tagbar from "@/components/shared/news/tagbar";
|
||||
import "/public/global.css"
|
||||
import "@/app/index.css"
|
||||
import styles from "./article.module.css"
|
||||
|
||||
import { serialize } from 'next-mdx-remote/serialize'
|
||||
import { MDXComponents, MDXContent } from "mdx/types";
|
||||
import { MDXRemote } from 'next-mdx-remote/rsc'
|
||||
|
||||
export default function Article(params: { id: string|undefined, title: string|undefined, content: string|undefined, date?:string|undefined } ) {
|
||||
export async function ExampleComponent(){
|
||||
return (
|
||||
<div>aaa</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default async function Article(params: { id: string|undefined, title: string|undefined, content: string|undefined, date?:string|undefined } ) {
|
||||
|
||||
|
||||
const components = { ExampleComponent }
|
||||
|
||||
return (
|
||||
<article id={`post-${params.id}`}>
|
||||
<h1 className=".article-title pl-5 pr-5">{params.title}</h1>
|
||||
<div className={`${styles.imagecontainer} m-5`}/>
|
||||
<div className="pl-5 pr-5"><Tagbar/></div>
|
||||
<p className=".article-content p-5">{params.content}</p>
|
||||
<div className=".article-content p-5">
|
||||
<MDXRemote
|
||||
source={params.content?params.content:""} components={components}
|
||||
/>
|
||||
</div>
|
||||
<section className=".article-date">{params.date}</section> <br/>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// export const getStaticProps: GetStaticProps<{
|
||||
// mdxSource: MDXRemoteSerializeResult
|
||||
// }> = async () => {
|
||||
// const mdxSource = await serialize('some *mdx* content: <ExampleComponent />')
|
||||
// return { props: { mdxSource } }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user