import { useState } from 'react';
import { useEventListener } from 'usehooks-ts';
export function useIsScrollTop(ref) {
    const [isTop, setIsTop] = useState(true);
    const onScroll = (event) => {
        if (event.target !== ref.current) {
            return;
        }
        setIsTop(ref.current?.scrollTop === 0);
    };
    useEventListener('scroll', onScroll, ref);
    return isTop;
}
//# sourceMappingURL=useIsScrollTop.js.map