mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 17:08:03 +08:00
feat: add db types in file tree icon
This commit is contained in:
@ -4,6 +4,7 @@ import {
|
||||
getFileExtension,
|
||||
isImageFile,
|
||||
isMarkdownFile,
|
||||
isSQLiteFile,
|
||||
isTextLikeFile,
|
||||
isVideoFile,
|
||||
} from '../utils/file-utils'
|
||||
@ -13,6 +14,7 @@ export type FileTypeInfo = {
|
||||
isCodeOrText: boolean
|
||||
isImage: boolean
|
||||
isVideo: boolean
|
||||
isSQLite: boolean
|
||||
isEditable: boolean
|
||||
isMediaFile: boolean
|
||||
}
|
||||
@ -23,6 +25,7 @@ export function useFileTypeInfo(fileNode: AppAssetTreeView | undefined): FileTyp
|
||||
const markdown = isMarkdownFile(ext)
|
||||
const image = isImageFile(ext)
|
||||
const video = isVideoFile(ext)
|
||||
const sqlite = isSQLiteFile(ext)
|
||||
const editable = isTextLikeFile(ext)
|
||||
const codeOrText = editable && !markdown
|
||||
|
||||
@ -31,6 +34,7 @@ export function useFileTypeInfo(fileNode: AppAssetTreeView | undefined): FileTyp
|
||||
isCodeOrText: codeOrText,
|
||||
isImage: image,
|
||||
isVideo: video,
|
||||
isSQLite: sqlite,
|
||||
isEditable: editable,
|
||||
isMediaFile: image || video,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user