import { memo } from 'react' import { useViewport } from 'reactflow' import { useStore } from '../store' import type { HelpLineHorizontalPosition, HelpLineVerticalPosition, } from './types' const HelpLineHorizontal = memo(({ top, left, width, }: HelpLineHorizontalPosition) => { const { x, y, zoom } = useViewport() return (
) }) HelpLineHorizontal.displayName = 'HelpLineBase' const HelpLineVertical = memo(({ top, left, height, }: HelpLineVerticalPosition) => { const { x, y, zoom } = useViewport() return (
) }) HelpLineVertical.displayName = 'HelpLineVertical' const HelpLine = () => { const helpLineHorizontal = useStore(s => s.helpLineHorizontal) const helpLineVertical = useStore(s => s.helpLineVertical) if (!helpLineHorizontal && !helpLineVertical) return null return ( <> { helpLineHorizontal && ( ) } { helpLineVertical && ( ) } ) } export default memo(HelpLine)