Skip to content

Build and run agents you can see, understand and trust.

681 B
Raw Blame
import { cjk } from '@streamdown/cjk';
import { code } from '@streamdown/code';
import { math } from '@streamdown/math';
import { mermaid } from '@streamdown/mermaid';
import * as React from 'react';
import { Streamdown } from 'streamdown';

import { cn } from '@/lib/utils';

const DEFAULT_PLUGINS = { code, math, cjk, mermaid };

function Markdown({
	className,
	plugins = DEFAULT_PLUGINS,
	controls = false,
	...props
}: React.ComponentProps<typeof Streamdown>) {
	return (
		<Streamdown
			data-slot="markdown"
			plugins={plugins}
			controls={controls}
			className={cn('cn-markdown w-full min-w-0 overflow-hidden', className)}
			{...props}
		/>
	);
}

export { Markdown };