'use client'; /** * PBL v2 — Markdown text renderer. * * Thin wrapper around `streamdown` (the same markdown renderer * OpenMAIC uses for AI-element messages) so Instructor replies, * milestone scripts, and document content render with consistent * typography and code formatting. */ import { Streamdown } from 'streamdown'; import { cn } from '@/lib/utils/cn'; interface Props { readonly content: string; readonly className?: string; } export function MarkdownText({ content, className }: Props) { return (
) scroll horizontally instead; keep the vertical axis clipped so
// the box height is unchanged. The absolutely-positioned header / copy
// button anchor to the outer code-block, so they stay put while scrolling.
'[&_div[data-streamdown=code-block-body]]:!overflow-x-auto [&_div[data-streamdown=code-block-body]]:!overflow-y-hidden',
'[&_div[data-streamdown=code-block-body]>pre]:!m-0 [&_div[data-streamdown=code-block-body]>pre]:!overflow-x-auto [&_div[data-streamdown=code-block-body]>pre]:!bg-transparent [&_div[data-streamdown=code-block-body]>pre]:!text-zinc-100',
'[&_div[data-streamdown=code-block-body]_code]:!text-zinc-100 [&_div[data-streamdown=code-block-body]_span]:!text-zinc-100',
className,
)}
>
{content}