import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { useMemo } from "react";
//#region src/components/table/hooks/useTransDataSourceGroupSetting.ts
const useTransDataSourceGroupSetting = (params) => {
	const { dataSourceGroup, originColumnsMap } = params;
	return useMemo(() => {
		if (dataSourceGroup && dataSourceGroup.show && dataSourceGroup.list) return _objectSpread2(_objectSpread2({}, dataSourceGroup), {}, { list: dataSourceGroup.list.map((item) => {
			let { name, label, columnKey, isCustom } = item;
			if (!isCustom && columnKey && originColumnsMap.has(columnKey)) {
				const column = originColumnsMap.get(columnKey);
				name = column.dataIndex || name;
				label = column.title || label;
			}
			return _objectSpread2(_objectSpread2({}, item), {}, {
				name,
				label
			});
		}) });
		return dataSourceGroup;
	}, [dataSourceGroup, originColumnsMap]);
};
//#endregion
export { useTransDataSourceGroupSetting as default };
