diff --git a/web/satellite/src/components/browser/galleryView/FilePreviewPlaceholder.vue b/web/satellite/src/components/browser/galleryView/FilePreviewPlaceholder.vue
new file mode 100644
index 000000000..a703fdc27
--- /dev/null
+++ b/web/satellite/src/components/browser/galleryView/FilePreviewPlaceholder.vue
@@ -0,0 +1,60 @@
+// Copyright (C) 2023 Storj Labs, Inc.
+// See LICENSE for copying information.
+
+
+
+
{{ file?.Key || '' }}
+
No preview available
+
+
+
+
+
+
+
diff --git a/web/satellite/src/components/browser/galleryView/GalleryView.vue b/web/satellite/src/components/browser/galleryView/GalleryView.vue
index b761c86e6..74210e430 100644
--- a/web/satellite/src/components/browser/galleryView/GalleryView.vue
+++ b/web/satellite/src/components/browser/galleryView/GalleryView.vue
@@ -8,8 +8,8 @@
@@ -57,40 +57,31 @@
+
+
+
-
-
{{ file?.Key || '' }}
-
No preview available
-
-
+
@@ -114,7 +105,6 @@
+
+
diff --git a/web/satellite/src/types/browser.ts b/web/satellite/src/types/browser.ts
index 7dadbd0b0..0cd65a0e9 100644
--- a/web/satellite/src/types/browser.ts
+++ b/web/satellite/src/types/browser.ts
@@ -77,3 +77,20 @@ export enum ShareType {
Folder = 'Folder',
Bucket = 'Bucket',
}
+
+export enum PreviewType {
+ None,
+ Text,
+ Image,
+ Video,
+ Audio,
+ PDF,
+}
+
+export const EXTENSION_PREVIEW_TYPES = new Map
([
+ [['txt'], PreviewType.Text],
+ [['bmp', 'svg', 'jpg', 'jpeg', 'png', 'ico', 'gif'], PreviewType.Image],
+ [['m4v', 'mp4', 'webm', 'mov', 'mkv'], PreviewType.Video],
+ [['m4a', 'mp3', 'wav', 'ogg'], PreviewType.Audio],
+ [['pdf'], PreviewType.PDF],
+]);
diff --git a/web/satellite/vuetify-poc/src/components/dialogs/filePreviewComponents/FilePreviewItem.vue b/web/satellite/vuetify-poc/src/components/dialogs/filePreviewComponents/FilePreviewItem.vue
index 48ba5d760..6b9807e68 100644
--- a/web/satellite/vuetify-poc/src/components/dialogs/filePreviewComponents/FilePreviewItem.vue
+++ b/web/satellite/vuetify-poc/src/components/dialogs/filePreviewComponents/FilePreviewItem.vue
@@ -54,19 +54,11 @@ import { useBucketsStore } from '@/store/modules/bucketsStore';
import { useNotify } from '@/utils/hooks';
import { AnalyticsErrorEventSource } from '@/utils/constants/analyticsEventNames';
import { useLinksharing } from '@/composables/useLinksharing';
+import { EXTENSION_PREVIEW_TYPES, PreviewType } from '@/types/browser';
import FilePreviewPlaceholder from '@poc/components/dialogs/filePreviewComponents/FilePreviewPlaceholder.vue';
import TextFilePreview from '@poc/components/dialogs/filePreviewComponents/TextFilePreview.vue';
-enum PreviewType {
- None,
- Text,
- Image,
- Video,
- Audio,
- PDF,
-}
-
const obStore = useObjectBrowserStore();
const bucketsStore = useBucketsStore();
const notify = useNotify();
@@ -75,14 +67,6 @@ const { generateObjectPreviewAndMapURL } = useLinksharing();
const isLoading = ref(false);
const previewAndMapFailed = ref(false);
-const extInfos = new Map([
- [['txt'], PreviewType.Text],
- [['bmp', 'svg', 'jpg', 'jpeg', 'png', 'ico', 'gif'], PreviewType.Image],
- [['m4v', 'mp4', 'webm', 'mov', 'mkv'], PreviewType.Video],
- [['m4a', 'mp3', 'wav', 'ogg'], PreviewType.Audio],
- [['pdf'], PreviewType.PDF],
-]);
-
const props = defineProps<{
file: BrowserObject,
active: boolean, // whether this item is visible
@@ -132,7 +116,7 @@ const previewType = computed(() => {
if (dotIdx === -1) return PreviewType.None;
const ext = props.file.Key.toLowerCase().slice(dotIdx + 1);
- for (const [exts, previewType] of extInfos) {
+ for (const [exts, previewType] of EXTENSION_PREVIEW_TYPES) {
if (exts.includes(ext)) return previewType;
}