/* istanbul ignore file */ /** * MarkdownContent Component * Renders markdown content with syntax highlighting and design system styling * This file is excluded from coverage as it's a documentation component */ import Image from 'next/image'; import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; import rehypeHighlight from 'rehype-highlight'; import rehypeSlug from 'rehype-slug'; import rehypeAutolinkHeadings from 'rehype-autolink-headings'; import { CodeBlock } from './CodeBlock'; import { cn } from '@/lib/utils'; import 'highlight.js/styles/atom-one-dark.css'; interface MarkdownContentProps { content: string; className?: string; } export function MarkdownContent({ content, className }: MarkdownContentProps) { return (
(

{children}

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

{children}

), h3: ({ children, ...props }) => (

{children}

), h4: ({ children, ...props }) => (

{children}

), // Paragraphs and text - improved readability p: ({ children, ...props }) => (

{children}

), strong: ({ children, ...props }) => ( {children} ), em: ({ children, ...props }) => ( {children} ), // Links - more prominent with better hover state a: ({ children, href, ...props }) => ( {children} ), // Lists - improved spacing and hierarchy ul: ({ children, ...props }) => ( ), ol: ({ children, ...props }) => (
    {children}
), li: ({ children, ...props }) => (
  • {children}
  • ), // Code blocks - enhanced with copy button and better styling code: ({ inline, className, children, ...props }: { inline?: boolean; className?: string; children?: React.ReactNode; }) => { if (inline) { return ( {children} ); } return ( {children} ); }, pre: ({ children, ...props }) => {children}, // Blockquotes - enhanced callout styling blockquote: ({ children, ...props }) => (
    {children}
    ), // Tables - improved styling with better borders and hover states table: ({ children, ...props }) => (
    {children}
    ), thead: ({ children, ...props }) => ( {children} ), tbody: ({ children, ...props }) => ( {children} ), tr: ({ children, ...props }) => ( {children} ), th: ({ children, ...props }) => ( {children} ), td: ({ children, ...props }) => ( {children} ), // Horizontal rule - more prominent hr: ({ ...props }) =>
    , // Images - optimized with Next.js Image component img: ({ src, alt }) => { if (!src || typeof src !== 'string') return null; return (
    {alt
    ); }, }} > {content}
    ); }