import { useEffect, useMemo, useRef } from "react";
const useNiceDropdownMaxHeight = function() {
    let deps = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
    const heightRef = useRef(0);
    useEffect(()=>{
        const handler = (e)=>{
            const { clientY } = e;
            const h = Math.max(clientY, window.innerHeight - clientY);
            heightRef.current = h;
        };
        window.addEventListener('mousemove', handler);
        return ()=>{
            window.removeEventListener('mousemove', handler);
        };
    }, []);
    return useMemo(()=>heightRef.current - 40, deps);
};
export { useNiceDropdownMaxHeight };
