feat: add tooltips

This commit is contained in:
Henry Li
2026-01-29 09:23:06 +08:00
parent c700bd6841
commit 6b030d7589

View File

@@ -36,6 +36,7 @@ import { cn } from "@/lib/utils";
import { useArtifacts } from "../artifacts"; import { useArtifacts } from "../artifacts";
import { FlipDisplay } from "../flip-display"; import { FlipDisplay } from "../flip-display";
import { Tooltip } from "../tooltip";
export function MessageGroup({ export function MessageGroup({
className, className,
@@ -232,15 +233,16 @@ function ToolCall({
}[]; }[];
} }
)?.results; )?.results;
console.info("image_search", results);
return ( return (
<ChainOfThoughtStep key={id} label={label} icon={SearchIcon}> <ChainOfThoughtStep key={id} label={label} icon={SearchIcon}>
{Array.isArray(results) && ( {Array.isArray(results) && (
<ChainOfThoughtSearchResults> <ChainOfThoughtSearchResults>
{Array.isArray(results) && {Array.isArray(results) &&
results.map((item) => ( results.map((item) => (
<Tooltip key={item.image_url} content={item.title}>
<a <a
className="size-24 overflow-hidden rounded-lg object-cover" className="size-24 overflow-hidden rounded-lg object-cover"
key={item.image_url}
href={item.source_url} href={item.source_url}
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
@@ -253,6 +255,7 @@ function ToolCall({
height={100} height={100}
/> />
</a> </a>
</Tooltip>
))} ))}
</ChainOfThoughtSearchResults> </ChainOfThoughtSearchResults>
)} )}