require("../../../_virtual/_rolldown/runtime.js");
let react = require("react");
//#region src/components/table/hooks/useGenScroll.ts
const useGenScroll = (params) => {
	const { wrapHeight, scroll: propsScroll, columns, isShowPagination } = params;
	return (0, react.useMemo)(() => {
		if (propsScroll === null || propsScroll === void 0 ? void 0 : propsScroll.autoCalc) return {
			x: (propsScroll === null || propsScroll === void 0 ? void 0 : propsScroll.x) || columns.reduce((p, c) => {
				return p + (c.width || 250);
			}, 0) || 2e3,
			y: (propsScroll === null || propsScroll === void 0 ? void 0 : propsScroll.y) || Math.max(wrapHeight - 48 - (isShowPagination ? 74 : 24), 100),
			scrollToFirstRowOnChange: propsScroll === null || propsScroll === void 0 ? void 0 : propsScroll.scrollToFirstRowOnChange
		};
		return propsScroll;
	}, [
		propsScroll,
		wrapHeight,
		columns,
		isShowPagination
	]);
};
//#endregion
exports.default = useGenScroll;
