import header_default from "../Table/tableConfig/header/index.js";
import body_default from "../Table/tableConfig/body/index.js";
import { useMemo } from "react";
import { isArr } from "@pisell/utils";
import { Form } from "antd";
//#region src/components/table/hooks/useGenTableComponents.ts
const useGenTableComponents = (params) => {
	const { form } = params;
	const group = Form.useWatch("group_by", {
		form,
		preserve: true
	});
	return useMemo(() => {
		return {
			header: {
				row: header_default.Row,
				cell: header_default.Cell
			},
			body: {
				row: body_default.Row,
				cell: body_default.Coll
			}
		};
	}, [useMemo(() => {
		return isArr(group) && group.length > 0;
	}, [group])]);
};
//#endregion
export { useGenTableComponents as default };
