import * as e from "react";
//#region lib/hooks/use-is-truncated.ts
function t(t = !0) {
	let [n, r] = e.useState(!1), i = e.useRef(t);
	i.current = t;
	let a = e.useRef(null), o = e.useCallback((e) => {
		if (a.current &&= (a.current.disconnect(), null), !e) return;
		let t = () => {
			i.current && r(e.scrollHeight > e.clientHeight + 1);
		};
		t(), a.current = new ResizeObserver(t), a.current.observe(e);
	}, []);
	return e.useEffect(() => {
		let e = a;
		return () => e.current?.disconnect();
	}, []), {
		ref: o,
		isTruncated: n
	};
}
//#endregion
export { t as useIsTruncated };
