feat: use ReportEditor after research report completed

This commit is contained in:
Jiang Feng
2025-04-27 00:19:13 +08:00
parent 66794a4b73
commit d77d3484c4
4 changed files with 28 additions and 95 deletions

View File

@@ -3,6 +3,7 @@
import { useRef } from "react";
import ReportEditor from "~/components/editor";
import { useMessage } from "~/core/store";
import { cn } from "~/lib/utils";
@@ -19,13 +20,20 @@ export function ResearchReportBlock({
}) {
const message = useMessage(messageId);
const contentRef = useRef<HTMLDivElement>(null);
const isCompleted = message?.isStreaming === false && message?.content !== "";
return (
<div
ref={contentRef}
className={cn("relative flex flex-col pb-8", className)}
>
<Markdown animate>{message?.content}</Markdown>
{message?.isStreaming && <LoadingAnimation className="my-12" />}
{isCompleted ? (
<ReportEditor content={message?.content} />
) : (
<>
<Markdown animate>{message?.content}</Markdown>
{message?.isStreaming && <LoadingAnimation className="my-12" />}
</>
)}
</div>
);
}