Improve data agent workspace UI
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import "@assistant-ui/react-markdown/styles/dot.css";
|
||||
|
||||
import { TextMessagePartProvider } from "@assistant-ui/core/react";
|
||||
import {
|
||||
type CodeHeaderProps,
|
||||
MarkdownTextPrimitive,
|
||||
@@ -15,14 +16,25 @@ import remarkGfm from "remark-gfm";
|
||||
import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const MarkdownTextImpl = () => {
|
||||
return (
|
||||
type MarkdownTextProps = {
|
||||
text?: string;
|
||||
isRunning?: boolean;
|
||||
};
|
||||
|
||||
const MarkdownTextImpl: FC<MarkdownTextProps> = ({ text, isRunning = false }) => {
|
||||
const content = (
|
||||
<MarkdownTextPrimitive
|
||||
remarkPlugins={[remarkGfm]}
|
||||
className="aui-md"
|
||||
components={defaultComponents}
|
||||
/>
|
||||
);
|
||||
if (text === undefined) return content;
|
||||
return (
|
||||
<TextMessagePartProvider text={text} isRunning={isRunning}>
|
||||
{content}
|
||||
</TextMessagePartProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export const MarkdownText = memo(MarkdownTextImpl);
|
||||
|
||||
Reference in New Issue
Block a user