Add tooltip for icons in review event list (#13334)

This commit is contained in:
Nicolas Mowen 2024-08-25 06:57:10 -06:00 committed by GitHub
parent ce79898cae
commit 453a8d794e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,6 +32,8 @@ import { Drawer, DrawerContent } from "../ui/drawer";
import axios from "axios";
import { toast } from "sonner";
import useKeyboardListener from "@/hooks/use-keyboard-listener";
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";
import { capitalizeFirstLetter } from "@/utils/stringUtil";
type ReviewCardProps = {
event: ReviewSegment;
@ -153,7 +155,10 @@ export default function ReviewCard({
}}
/>
<div className="flex items-center justify-between">
<Tooltip>
<TooltipTrigger asChild>
<div className="flex items-center justify-evenly gap-1">
<>
{event.data.objects.map((object) => {
return getIconForLabel(
object,
@ -166,8 +171,27 @@ export default function ReviewCard({
"size-3 text-primary dark:text-white",
);
})}
</>
<div className="font-extra-light text-xs">{formattedDate}</div>
</div>
</TooltipTrigger>
<TooltipContent className="capitalize">
{[
...new Set([
...(event.data.objects || []),
...(event.data.sub_labels || []),
...(event.data.audio || []),
]),
]
.filter(
(item) => item !== undefined && !item.includes("-verified"),
)
.map((text) => capitalizeFirstLetter(text))
.sort()
.join(", ")
.replaceAll("-verified", "")}
</TooltipContent>
</Tooltip>
<TimeAgo
className="text-xs text-muted-foreground"
time={event.start_time * 1000}