import { c } from "react/compiler-runtime";
import { useCallback, useRef } from "react";
const useScrollToListItem = () => {
	let n = c(2), r = useRef(null), i;
	n[0] === Symbol.for("react.memo_cache_sentinel") ? (i = (e) => {
		if (r.current && e) {
			let n = Array.from(r.current.children[0].children).find((n) => n.dataset.id?.endsWith(e));
			if (n) {
				let e = n.getBoundingClientRect().top + window.pageYOffset - 70;
				window.scrollTo({
					top: e,
					behavior: "smooth"
				});
			}
		}
	}, n[0] = i) : i = n[0];
	let a = i, o;
	return n[1] === Symbol.for("react.memo_cache_sentinel") ? (o = {
		listRef: r,
		scrollTo: a
	}, n[1] = o) : o = n[1], o;
};
export { useScrollToListItem };
