mirror of
https://github.com/langgenius/dify.git
synced 2026-04-30 23:48:04 +08:00
missing files
This commit is contained in:
13
web/app/components/workflow/skill/utils.ts
Normal file
13
web/app/components/workflow/skill/utils.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { FileAppearanceTypeEnum } from '@/app/components/base/file-uploader/types'
|
||||
|
||||
export const getFileIconType = (name: string) => {
|
||||
const extension = name.split('.').pop()?.toLowerCase() ?? ''
|
||||
|
||||
if (['md', 'markdown', 'mdx'].includes(extension))
|
||||
return FileAppearanceTypeEnum.markdown
|
||||
|
||||
if (['json', 'yaml', 'yml', 'toml', 'js', 'jsx', 'ts', 'tsx', 'py', 'schema'].includes(extension))
|
||||
return FileAppearanceTypeEnum.code
|
||||
|
||||
return FileAppearanceTypeEnum.document
|
||||
}
|
||||
Reference in New Issue
Block a user