feat: add file preview modal (#945)
This commit is contained in:
12
app/assets/javascripts/components/Files/isFilePreviewable.ts
Normal file
12
app/assets/javascripts/components/Files/isFilePreviewable.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export const isFileTypePreviewable = (fileType: string) => {
|
||||
const isImage = fileType.startsWith('image/');
|
||||
const isVideo = fileType.startsWith('video/');
|
||||
const isAudio = fileType.startsWith('audio/');
|
||||
const isPdf = fileType === 'application/pdf';
|
||||
|
||||
if (isImage || isVideo || isAudio || isPdf) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
Reference in New Issue
Block a user