feat: integrated with artifacts in states

This commit is contained in:
Henry Li
2026-01-17 17:21:37 +08:00
parent ab65ab3af2
commit 9a3f72869c
8 changed files with 118 additions and 70 deletions

View File

@@ -24,12 +24,13 @@ export function ArtifactFileList({
files: string[];
threadId: string;
}) {
const { openArtifact } = useArtifacts();
const { select: selectArtifact, setOpen } = useArtifacts();
const handleClick = useCallback(
(filepath: string) => {
openArtifact(filepath);
selectArtifact(filepath);
setOpen(true);
},
[openArtifact],
[selectArtifact, setOpen],
);
return (
<ul className={cn("flex w-full flex-col gap-4", className)}>