"use client"; import { useTranslation } from "@/components/i18n/locale-provider"; import { InfoIcon } from "lucide-react"; import { useSyncExternalStore } from "react"; import { Drawer, DrawerContent, DrawerDescription, DrawerHeader, DrawerTitle, DrawerTrigger, } from "@/components/ui/drawer"; import { HoverCard, HoverCardContent, HoverCardTrigger, } from "@/components/ui/hover-card"; const finePointerQuery = "(hover: hover) and (pointer: fine)"; function subscribe(callback: () => void) { const query = window.matchMedia(finePointerQuery); query.addEventListener("change", callback); return () => query.removeEventListener("change", callback); } function getSnapshot() { return window.matchMedia(finePointerQuery).matches; } function Trigger({ label }: { label: string }) { return ( {label} ); } export function TermDetail({ label, detail, }: { label: string; detail: string; }) { const { t } = useTranslation(); const finePointer = useSyncExternalStore(subscribe, getSnapshot, () => false); if (finePointer) { return (

{label}

{detail}

); } return ( {label} {detail}
); }