import { useApiHost } from "@/api"; import { baseUrl } from "@/api/baseUrl"; import { useTranslation } from "react-i18next"; import { LuExternalLink } from "react-icons/lu"; import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; type ChatEvent = { id: string; score?: number }; type ChatEventThumbnailsRowProps = { events: ChatEvent[]; anchor?: { id: string } | null; onAttach?: (eventId: string) => void; }; /** * Horizontal scroll row of event thumbnail images for chat. * Optionally renders an anchor thumbnail with a "reference" badge above the * results, and per-event similarity scores when provided. * Clicking a thumbnail calls onAttach; a small external-link overlay opens * the event in Explore. * Renders nothing when there is nothing to show. */ export function ChatEventThumbnailsRow({ events, anchor = null, onAttach, }: ChatEventThumbnailsRowProps) { const apiHost = useApiHost(); const { t } = useTranslation(["views/chat"]); if (events.length === 0 && !anchor) return null; const renderThumb = (event: ChatEvent, isAnchor = false) => (