import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { isMobile } from "../../../utils/platform.js";
import { useMemo } from "react";
//#region src/components/table/hooks/useTransFilterSetting.ts
const useTransFilterSetting = (params) => {
	const { filter, originColumnsMap } = params;
	return useMemo(() => {
		if (filter && filter.show && filter.list) return _objectSpread2(_objectSpread2({}, filter), {}, { list: filter.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,
				sort: isMobile() ? true : item.sort
			});
		}) });
		return filter;
	}, [filter, originColumnsMap]);
};
//#endregion
export { useTransFilterSetting as default };
