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