import React from 'react'; import Markdown from 'react-markdown'; import { Card, CardBody } from '@nextui-org/card'; import remarkGfm from 'remark-gfm'; import remarkToc from 'remark-toc'; import remarkFrontmatter from 'remark-frontmatter'; import axios from 'axios'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { oneDark } from 'react-syntax-highlighter/dist/esm/styles/prism'; import rehypeRaw from 'rehype-raw'; import rehypeSanitize from 'rehype-sanitize'; import Headers from '@/app/blog/post/[id]/Headers'; type Props = { id: string } async function PostCard(props: Props) { let response: any; try { response = await axios(`${ process.env.BACKEND_URL }/get_post/${ props.id }`); } catch (e) { return ( Fatal: Failed to load the post. ); } let post_data = response.data; return (
{/* card headers*/ } {/* card body */ } { String((children as any)['props']['children']).replace(/\n$/, '') } ); } else { return (
                                            
                                                { children }
                                            
                                        
); } } } } >{ (post_data as any)['content'] }
); } export default PostCard;