import React from 'react'; interface RichTextSectionProps { markdown?: string; } export function RichTextSection({ markdown = '' }: RichTextSectionProps) { // Simple, safe markdown to HTML parser for headers, lists, and paragraphs const renderFormatted = (text: string) => { const lines = text.split('\n'); return lines.map((line, idx) => { if (line.startsWith('### ')) { return (

{line.replace('### ', '')}

); } if (line.startsWith('1. ') || line.startsWith('2. ') || line.startsWith('3. ') || line.startsWith('4. ')) { return (
{line.slice(0, 3)} {line.slice(3)}
); } if (line.trim().length === 0) { return
; } return (

{line}

); }); }; return (
{renderFormatted(markdown)}
); }