//#region src/components/PisellSuperTabs/utils/getRowKey.ts
/**
* 获取数据项的唯一标识
* @param record - 数据项
* @param index - 索引
* @param rowKey - key 字段配置
* @returns 唯一标识字符串
*/
const getRowKey = (record, index, rowKey) => {
	if (typeof rowKey === "function") return rowKey(record, index);
	if (typeof rowKey === "string") {
		const key = record === null || record === void 0 ? void 0 : record[rowKey];
		if (key !== void 0 && key !== null) return String(key);
	}
	const defaultKey = record === null || record === void 0 ? void 0 : record.key;
	if (defaultKey !== void 0 && defaultKey !== null) return String(defaultKey);
	if (process.env.NODE_ENV === "development") console.warn("[PisellSuperTabs] rowKey is not found in data item, using index as fallback. This may cause issues with state management.", record);
	return String(index);
};
//#endregion
export { getRowKey };
