"use strict";

exports.__esModule = true;
exports.useIsScrollTop = useIsScrollTop;
var _react = require("react");
var _usehooksTs = require("usehooks-ts");
function useIsScrollTop(ref) {
  const [isTop, setIsTop] = (0, _react.useState)(true);
  const onScroll = event => {
    var _ref$current;
    if (event.target !== ref.current) {
      return;
    }
    setIsTop(((_ref$current = ref.current) == null ? void 0 : _ref$current.scrollTop) === 0);
  };
  (0, _usehooksTs.useEventListener)('scroll', onScroll, ref);
  return isTop;
}
//# sourceMappingURL=useIsScrollTop.js.map