"use client" import ReactMarkdown from "react-markdown" import remarkGfm from "remark-gfm" interface MarkdownPreviewProps { content: string } export function MarkdownPreview({ content }: MarkdownPreviewProps) { return (
(

{children}

), h2: ({ children }) => (

{children}

), h3: ({ children }) =>

{children}

, p: ({ children }) =>

{children}

, strong: ({ children }) => {children}, em: ({ children }) => {children}, code({ inline, className, children, ...props }) { if (inline) { return ( {children} ) } // block code return (
code
                    {children}
                  
) }, blockquote: ({ children }) => (
{children}
), ul: ({ children }) =>
    {children}
, ol: ({ children }) =>
    {children}
, li: ({ children, ...props }) => { const isOrdered = props.node?.parent?.tagName === "ol" return (
  • {isOrdered ? ( {/* Counter will be handled by CSS */} ) : ( )}
    {children}
  • ) }, a: ({ children, href }) => ( {children} ), table({ children }) { return (
    {children}
    ) }, th({ children }) { return ( {children} ) }, td({ children }) { return ( {children} ) }, hr: () => (
    ), }} > {content || (

    Start typing to see the magic happen...

    Your markdown will appear here in real-time!

    )}
    ) }