/** * Renders final (non-streaming) markdown as HTML: reasoning + think collapsibles + main. * Used for agent final output and any other source that uses the marked → HTML pipeline. */ import React from 'react' import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible' import { ChevronDown } from 'lucide-react' import type { RenderingNodeState } from '../useRenderingNodeState' const MARKDOWN_CLASS = 'rendering-markdown p-3 text-sm [&_h1]:text-lg [&_h2]:text-base [&_h3]:text-sm [&_ul]:list-disc [&_ol]:list-decimal [&_ul]:pl-5 [&_ol]:pl-5 [&_p]:my-1.5 [&_pre]:bg-muted [&_pre]:p-2 [&_pre]:rounded text-muted-foreground' const MARKDOWN_MAIN_CLASS = 'rendering-markdown min-h-0 flex-1 w-full overflow-auto p-3 text-sm [&_h1]:text-xl [&_h2]:text-lg [&_h3]:text-base [&_ul]:list-disc [&_ol]:list-decimal [&_ul]:pl-5 [&_ol]:pl-5 [&_p]:my-2 [&_pre]:bg-muted [&_pre]:p-2 [&_pre]:rounded' export type StaticMarkdownHtmlViewProps = { state: RenderingNodeState } export function StaticMarkdownHtmlView({ state }: StaticMarkdownHtmlViewProps) { return (
{state.reasoningHtml ? ( Reasoning
) : null} {state.renderedThinkSplit.think ? ( Thinking
) : null}
) }