'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 (
span]:ml-0', '[&_*:has(>div[data-streamdown=code-block-actions])]:!static [&_*:has(>div[data-streamdown=code-block-actions])]:!m-0', '[&_*:has(>div[data-streamdown=code-block-actions])]:!h-0 [&_*:has(>div[data-streamdown=code-block-actions])]:!p-0', '[&_div[data-streamdown=code-block-actions]]:!absolute [&_div[data-streamdown=code-block-actions]]:!bottom-1.5 [&_div[data-streamdown=code-block-actions]]:!right-1.5', '[&_div[data-streamdown=code-block-actions]]:!rounded-md [&_div[data-streamdown=code-block-actions]]:!border-white/10 [&_div[data-streamdown=code-block-actions]]:!bg-zinc-900/85 [&_div[data-streamdown=code-block-actions]]:!text-zinc-300', '[&_div[data-streamdown=code-block-body]]:!min-h-[76px] [&_div[data-streamdown=code-block-body]]:!rounded-none [&_div[data-streamdown=code-block-body]]:!border-0', '[&_div[data-streamdown=code-block-body]]:!bg-transparent [&_div[data-streamdown=code-block-body]]:!px-3 [&_div[data-streamdown=code-block-body]]:!pb-10 [&_div[data-streamdown=code-block-body]]:!pt-8', '[&_div[data-streamdown=code-block-body]]:!text-[13px] [&_div[data-streamdown=code-block-body]]:!text-zinc-100', // streamdown ships the code body as `overflow-hidden`, so a long line is // clipped on the right with no way to reach it. Make the body (and its //
) 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}
    
); }