require("../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
let react = require("react");
let _pisell_utils = require("@pisell/utils");
//#region src/components/table/hooks/useTransSortSetting.ts
const useTransSortSetting = (params) => {
	const { sort, originColumnsMap } = params;
	return (0, react.useMemo)(() => {
		if (sort && sort.show && sort.list) return require_objectSpread2._objectSpread2(require_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 require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, item), {}, {
				localFilter: (0, _pisell_utils.isBoolean)(localFilter) ? localFilter : true,
				name,
				label
			});
		}) });
		return sort;
	}, [sort, originColumnsMap]);
};
//#endregion
exports.default = useTransSortSetting;
