import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
import rehypeRaw from 'rehype-raw';
import { CodeRenderer } from './CodeRenderer';
import { MermaidRenderer } from './MermaidRenderer';
import type { RenderableContent } from '../../types';
interface ContentRendererProps {
content: string;
className?: string;
}
export function ContentRenderer({ content, className = '' }: ContentRendererProps) {
// Detect content type and render accordingly
const renderableContent = detectContentType(content);
switch (renderableContent.type) {
case 'mermaid':
return
{children}
);
},
// Custom link rendering
a({ href, children, ...props }) {
return (
{children}
);
},
// Custom table rendering
table({ children, ...props }) {
return (
{children}); }, }} > {content}