Skip to content

Commit 9689bca

Browse files
committed
fix(files): include images in workspace type filter
1 parent b72e737 commit 9689bca

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/files

apps/sim/app/workspace/[workspaceId]/files/files.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
getFileExtension,
3737
getMimeTypeFromExtension,
3838
isAudioFileType,
39+
isImageFileType,
3940
isVideoFileType,
4041
} from '@/lib/uploads/utils/file-utils'
4142
import {
@@ -249,6 +250,7 @@ export function Files() {
249250
if (typeFilter.includes('document') && isSupportedExtension(ext)) return true
250251
if (typeFilter.includes('audio') && isAudioFileType(f.type)) return true
251252
if (typeFilter.includes('video') && isVideoFileType(f.type)) return true
253+
if (typeFilter.includes('image') && isImageFileType(f.type)) return true
252254
return false
253255
})
254256
}
@@ -929,9 +931,14 @@ export function Files() {
929931
typeFilter.length === 0
930932
? 'All'
931933
: typeFilter.length === 1
932-
? (({ document: 'Documents', audio: 'Audio', video: 'Video' } as Record<string, string>)[
933-
typeFilter[0]
934-
] ?? typeFilter[0])
934+
? ((
935+
{
936+
document: 'Documents',
937+
image: 'Images',
938+
audio: 'Audio',
939+
video: 'Video',
940+
} as Record<string, string>
941+
)[typeFilter[0]] ?? typeFilter[0])
935942
: `${typeFilter.length} selected`
936943

937944
const sizeDisplayLabel =
@@ -957,6 +964,7 @@ export function Files() {
957964
<Combobox
958965
options={[
959966
{ value: 'document', label: 'Documents' },
967+
{ value: 'image', label: 'Images' },
960968
{ value: 'audio', label: 'Audio' },
961969
{ value: 'video', label: 'Video' },
962970
]}
@@ -1039,6 +1047,7 @@ export function Files() {
10391047
if (typeFilter.length > 0) {
10401048
const typeLabels: Record<string, string> = {
10411049
document: 'Documents',
1050+
image: 'Images',
10421051
audio: 'Audio',
10431052
video: 'Video',
10441053
}

0 commit comments

Comments
 (0)