refactor: extract various constants

This commit is contained in:
2025-11-25 10:10:42 +01:00
parent 4d30e47ee8
commit ccc22beda2
40 changed files with 326 additions and 216 deletions
+1 -23
View File
@@ -3,6 +3,7 @@ import type { JSX } from 'react';
import DocumentInfoPanel from '../documents/DocumentInfoPanel';
import { DownloadIcon } from '../ui/icons';
import PdfViewer from './PdfViewer';
import { AUDIO_EXTENSIONS, VIDEO_EXTENSIONS } from '../constants/preview';
interface DocumentLike {
id?: string;
@@ -48,29 +49,6 @@ interface DocumentViewerLayoutProps {
layoutMode?: LayoutMode;
}
const AUDIO_EXTENSIONS = new Set([
'aac',
'aiff',
'flac',
'm4a',
'mp3',
'ogg',
'oga',
'opus',
'wav',
'weba',
]);
const VIDEO_EXTENSIONS = new Set([
'avi',
'mkv',
'mov',
'mp4',
'm4v',
'webm',
'wmv',
]);
const getFileExtension = (filename?: string | null) => {
if (!filename) {
return '';