add tooltip

This commit is contained in:
Josh Hawkins 2026-04-09 09:09:25 -05:00
parent b1b43884b8
commit 925541cbd8
2 changed files with 21 additions and 15 deletions

View File

@ -12,6 +12,7 @@
"result": "Result", "result": "Result",
"arguments": "Arguments:", "arguments": "Arguments:",
"response": "Response:", "response": "Response:",
"attachment_chip_label": "{{label}} on {{camera}}",
"attachment_chip_remove": "Remove attachment", "attachment_chip_remove": "Remove attachment",
"open_in_explore": "Open in Explore", "open_in_explore": "Open in Explore",
"attach_event_aria": "Attach event {{eventId}}", "attach_event_aria": "Attach event {{eventId}}",

View File

@ -1,6 +1,11 @@
import { useApiHost } from "@/api"; import { useApiHost } from "@/api";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { LuExternalLink } from "react-icons/lu"; import { LuExternalLink } from "react-icons/lu";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
type ChatEvent = { id: string; score?: number }; type ChatEvent = { id: string; score?: number };
@ -50,6 +55,8 @@ export function ChatEventThumbnailsRow({
loading="lazy" loading="lazy"
/> />
</button> </button>
<Tooltip>
<TooltipTrigger asChild>
<a <a
href={`/explore?event_id=${event.id}`} href={`/explore?event_id=${event.id}`}
target="_blank" target="_blank"
@ -60,11 +67,9 @@ export function ChatEventThumbnailsRow({
> >
<LuExternalLink className="size-3" /> <LuExternalLink className="size-3" />
</a> </a>
{typeof event.score === "number" && !isAnchor && ( </TooltipTrigger>
<span className="pointer-events-none absolute bottom-1 right-1 rounded bg-black/60 px-1 text-[10px] text-white"> <TooltipContent>{t("open_in_explore")}</TooltipContent>
{Math.round(event.score * 100)}% </Tooltip>
</span>
)}
{isAnchor && ( {isAnchor && (
<span className="pointer-events-none absolute left-1 top-1 rounded bg-primary px-1 text-[10px] text-primary-foreground"> <span className="pointer-events-none absolute left-1 top-1 rounded bg-primary px-1 text-[10px] text-primary-foreground">
{t("anchor")} {t("anchor")}