| 1 | import type { ComponentProps, ReactNode } from "react"; |
| 2 | import { TooltipPopup } from "./ui/tooltip"; |
| 3 | import { cn } from "~/lib/utils"; |
| 4 | |
| 5 | export function ThreadHoverCardPopup({ className, ...props }: ComponentProps<typeof TooltipPopup>) { |
| 6 | return ( |
| 7 | <TooltipPopup |
| 8 | {...props} |
| 9 | variant="glass" |
| 10 | className={cn("max-w-80 text-left whitespace-normal", className)} |
| 11 | /> |
| 12 | ); |
| 13 | } |
| 14 | |
| 15 | /** Shared title, metadata spacing, and optional footer for thread previews. */ |
| 16 | export function ThreadHoverCard({ |
| 17 | title, |
| 18 | children, |
| 19 | footer, |
| 20 | }: { |
| 21 | title: string; |
| 22 | children: ReactNode; |
| 23 | footer?: ReactNode; |
| 24 | }) { |
| 25 | return ( |
| 26 | <div className="flex min-w-0 max-w-80 flex-col gap-2 px-1 py-2"> |
| 27 | <div className="min-w-0 truncate text-xs leading-tight font-medium text-foreground"> |
| 28 | {title} |
| 29 | </div> |
| 30 | <div className="grid gap-1.5 pl-0.5 text-xs text-muted-foreground">{children}</div> |
| 31 | {footer} |
| 32 | </div> |
| 33 | ); |
| 34 | } |