refactor: extract various constants
This commit is contained in:
@@ -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 '';
|
||||
|
||||
Reference in New Issue
Block a user