import { NostrLink, NostrPrefix } from "@snort/system"; import { useUserProfile } from "@snort/system-react"; import { useCallback, useRef, useState } from "react"; import DisplayName from "@/Components/User/DisplayName"; import { ProfileCard } from "@/Components/User/ProfileCard"; import { ProfileLink } from "@/Components/User/ProfileLink"; export default function Mention({ link }: { link: NostrLink }) { const profile = useUserProfile(link.id); const [isHovering, setIsHovering] = useState(false); const hoverTimeoutRef = useRef(null); const handleMouseEnter = useCallback(() => { hoverTimeoutRef.current && clearTimeout(hoverTimeoutRef.current); hoverTimeoutRef.current = setTimeout(() => setIsHovering(true), 100); // Adjust timeout as needed }, []); const handleMouseLeave = useCallback(() => { hoverTimeoutRef.current && clearTimeout(hoverTimeoutRef.current); hoverTimeoutRef.current = setTimeout(() => setIsHovering(false), 300); // Adjust timeout as needed }, []); if (link.type !== NostrPrefix.Profile && link.type !== NostrPrefix.PublicKey) return; return ( e.stopPropagation()}> @ {isHovering && } ); }