77 :class =" fileListIconStyles['file-picker__file-icon']" >
88 <template v-if =" ! previewLoaded " >
99 <IconFile v-if =" isFile" :size =" 20" />
10+ <component :is =" folderDecorationIcon" v-else-if =" folderDecorationIcon" />
1011 <IconFolder v-else :size =" 20" />
1112 </template >
1213 </div >
@@ -19,6 +20,12 @@ import { usePreviewURL } from '../../composables/preview'
1920
2021import IconFile from ' vue-material-design-icons/File.vue'
2122import IconFolder from ' vue-material-design-icons/Folder.vue'
23+ import LockIcon from ' vue-material-design-icons/Lock.vue'
24+ import TagIcon from ' vue-material-design-icons/Tag.vue'
25+ import LinkIcon from ' vue-material-design-icons/Link.vue'
26+ import AccountPlusIcon from ' vue-material-design-icons/AccountPlus.vue'
27+ import NetworkIcon from ' vue-material-design-icons/Network.vue'
28+ import AccountGroupIcon from ' vue-material-design-icons/AccountGroup.vue'
2229
2330// CSS modules
2431import fileListIconStylesModule from ' ./FileListIcon.module.scss'
@@ -37,6 +44,45 @@ const {
3744} = usePreviewURL (toRef (props , ' node' ), computed (() => ({ cropPreview: props .cropImagePreviews })))
3845
3946const isFile = computed (() => props .node .type === FileType .File )
47+ const folderDecorationIcon = computed (() => {
48+ if (props .node .type !== FileType .Folder ) {
49+ return null
50+ }
51+
52+ // Encrypted folders
53+ if (props .node .attributes ?.[' is-encrypted' ] === 1 ) {
54+ return LockIcon
55+ }
56+
57+ // System tags
58+ if (props .node .attributes ?.[' is-tag' ]) {
59+ return TagIcon
60+ }
61+
62+ // Link and mail shared folders
63+ const shareTypes = Object .values (props .node .attributes ?.[' share-types' ] || {}).flat () as number []
64+ if (shareTypes .some (type => type === ShareType .Link || type === ShareType .Email )) {
65+ return LinkIcon
66+ }
67+
68+ // Shared folders
69+ if (shareTypes .length > 0 ) {
70+ return AccountPlusIcon
71+ }
72+
73+ switch (props .node .attributes ?.[' mount-type' ]) {
74+ case ' external' :
75+ case ' external-session' :
76+ return NetworkIcon
77+ case ' group' :
78+ return AccountGroupIcon
79+ case ' shared' :
80+ return AccountPlusIcon
81+ }
82+
83+ return null
84+
85+ })
4086 </script >
4187
4288<script lang="ts">
0 commit comments