Refactoring: Integrating the file preview component (#11523)

### What problem does this PR solve?

Refactoring: Integrating the file preview component

### Type of change

- [x] Refactoring
This commit is contained in:
chanx
2025-11-25 19:13:00 +08:00
committed by GitHub
parent a793dd2ea8
commit 5d0981d046
38 changed files with 216 additions and 1222 deletions

View File

@ -45,21 +45,23 @@ export const useListDataSource = () => {
const updatedDataSourceTemplates = useMemo(() => {
const categorizedData = categorizeDataBySource(list || []);
let sourcelist: Array<IDataSorceInfo & { list: Array<IDataSourceBase> }> =
let sourceList: Array<IDataSorceInfo & { list: Array<IDataSourceBase> }> =
[];
Object.keys(categorizedData).forEach((key: string) => {
const k = key as DataSourceKey;
sourcelist.push({
id: k,
name: DataSourceInfo[k].name,
description: DataSourceInfo[k].description,
icon: DataSourceInfo[k].icon,
list: categorizedData[k] || [],
});
if (DataSourceInfo[k]) {
sourceList.push({
id: k,
name: DataSourceInfo[k].name,
description: DataSourceInfo[k].description,
icon: DataSourceInfo[k].icon,
list: categorizedData[k] || [],
});
}
});
console.log('🚀 ~ useListDataSource ~ sourcelist:', sourcelist);
return sourcelist;
console.log('🚀 ~ useListDataSource ~ sourceList:', sourceList);
return sourceList;
}, [list]);
return { list, categorizedList: updatedDataSourceTemplates, isFetching };