import { useThree } from '@react-three/fiber'; import { Line } from '@visx/shape'; import { TooltipWithBounds } from '@visx/tooltip'; import type { ReactNode } from 'react'; import Overlay from './Overlay'; import styles from './TooltipMesh.module.css'; interface Props { tooltipOpen: boolean; tooltipLeft: number | undefined; tooltipTop: number | undefined; guides?: 'horizontal' | 'vertical' | 'both'; children?: ReactNode; } function TooltipOverlay(props: Props) { const { tooltipOpen, tooltipLeft, tooltipTop, guides, children } = props; const { width, height } = useThree((state) => state.size); return ( {tooltipOpen && children && ( <> {children} {guides && ( {guides !== 'horizontal' && ( )} {guides !== 'vertical' && ( )} )} )} ); } export default TooltipOverlay;