import { HoverCard, HoverCardContent, HoverCardTrigger, } from "@/src/components/ui/hover-card"; import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture"; import { cn } from "@/src/utils/tailwind"; import { Portal } from "@radix-ui/react-hover-card"; import { Info } from "lucide-react"; export type DocPopupProps = { description: React.ReactNode; href?: string; className?: string; }; export default function DocPopup({ description, href, className, }: DocPopupProps) { const capture = usePostHogClientCapture(); return ( { if (open) { capture("help_popup:opened", { hfref: href, description: description, }); } }} > { if (!href) return; e.preventDefault(); e.stopPropagation(); window.open(href, "_blank"); capture("help_popup:href_clicked", { href: href, description: description, }); }} > {typeof description === "string" ? ( {description} ) : ( description )} ); } export type PopupProps = { triggerContent: React.ReactNode; description: React.ReactNode; }; export function Popup({ triggerContent, description }: PopupProps) { return ( {triggerContent} {typeof description === "string" ? ( {description} ) : ( description )} ); }