import { useState as u, useEffect as b } from "react";
import { DEFAULT_MIN_HEIGHT_THRESHOLD as f } from "./constants.js";
const I = (e, t = f) => {
  const [c, r] = u(!0);
  return b(() => {
    const o = new ResizeObserver((s) => {
      for (const n of s) {
        const i = n.contentRect.height >= t;
        r(i);
      }
    });
    if (e.current) {
      o.observe(e.current);
      const s = e.current.getBoundingClientRect();
      r(s.height >= t);
    }
    return () => {
      o.disconnect();
    };
  }, [e, t]), c;
};
export {
  I as useIsVisible
};
