'use server'; import React from 'react'; import Markdown from 'react-markdown'; import { Card, CardBody } from '@nextui-org/card'; import remarkGfm from 'remark-gfm'; import rehypeHighlight from 'rehype-highlight'; import rehypeSanitize from 'rehype-sanitize'; import rehypeRaw from 'rehype-raw'; import remarkToc from 'remark-toc'; type Props = { id: string } async function Generate(props: Props) { const response = await fetch(`${ process.env.BLOG_ENDPOINT }/posts/${ props.id }`); if (!response.ok) { throw new Error(response.statusText); } const post_md = await response.text(); console.log(post_md); return (
{ post_md }
); } export default Generate;