mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-22 07:56:48 +00:00
feat: support artifact preview
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { loadArtifactContent } from "./loader";
|
||||
|
||||
export function useArtifactContent({
|
||||
filepath,
|
||||
threadId,
|
||||
enabled,
|
||||
}: {
|
||||
filepath: string;
|
||||
threadId: string;
|
||||
enabled?: boolean;
|
||||
}) {
|
||||
const { data, isLoading, error } = useQuery({
|
||||
queryKey: ["artifact", filepath, threadId],
|
||||
queryFn: () => loadArtifactContent({ filepath, threadId }),
|
||||
enabled,
|
||||
});
|
||||
return { content: data, isLoading, error };
|
||||
}
|
||||
Reference in New Issue
Block a user