Files
FastGPT/packages/global/core/dataset/utils.ts
2023-10-22 23:54:04 +08:00

22 lines
707 B
TypeScript

import { DatasetCollectionTypeEnum } from './constant';
import { getFileIcon } from '../../common/file/icon';
export function getCollectionIcon(
type: `${DatasetCollectionTypeEnum}` = DatasetCollectionTypeEnum.file,
name = ''
) {
if (type === DatasetCollectionTypeEnum.folder) {
return '/imgs/files/folder.svg';
} else if (type === DatasetCollectionTypeEnum.link) {
return '/imgs/files/link.svg';
} else if (type === DatasetCollectionTypeEnum.virtual) {
if (name === '手动录入') {
return '/imgs/files/manual.svg';
} else if (name === '手动标注') {
return '/imgs/files/mark.svg';
}
return '/imgs/files/collection.svg';
}
return getFileIcon(name);
}