import { JSX } from 'preact'; import { useEffect, useRef } from 'preact/hooks'; import './ResizeHandle.css'; interface ResizeHandleProps { onMouseDown: (e: MouseEvent) => void; isDragging: boolean; } export function ResizeHandle({ onMouseDown, isDragging }: ResizeHandleProps): JSX.Element { const handleRef = useRef(null); useEffect(() => { const handleElement = handleRef.current; if (!handleElement) return; const handleMouseDown = (e: MouseEvent) => { e.preventDefault(); onMouseDown(e); }; handleElement.addEventListener('mousedown', handleMouseDown); return () => { handleElement.removeEventListener('mousedown', handleMouseDown); }; }, [onMouseDown]); return (
); }