'use client'; import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { vscDarkPlus } from 'react-syntax-highlighter/dist/esm/styles/prism'; import type { Topic } from '@/types'; interface Props { topic: Topic; lessonContent: string | null; isGenerating: boolean; streamingContent: string; } export default function LessonPane({ topic, lessonContent, isGenerating, streamingContent }: Props) { const content = lessonContent ?? (isGenerating ? streamingContent : null); return (
{/* Header */}
{topic.label} {isGenerating && (
Writing lesson…
)}
{/* Content */}
{!content ? (
) : (
} language={match[1]} PreTag="div" customStyle={{ margin: '0.75rem 0', borderRadius: '0.375rem', fontSize: '0.8rem' }} > {String(children).replace(/\n$/, '')} ) : ( {children} ); }, h1: ({ children }) =>

{children}

, h2: ({ children }) =>

{children}

, h3: ({ children }) =>

{children}

, p: ({ children }) =>

{children}

, ul: ({ children }) =>
    {children}
, ol: ({ children }) =>
    {children}
, li: ({ children }) =>
  • {children}
  • , strong: ({ children }) => {children}, blockquote: ({ children }) => (
    {children}
    ), hr: () =>
    , table: ({ children }) => (
    {children}
    ), th: ({ children }) => {children}, td: ({ children }) => {children}, }} > {content}
    )}
    ); }