feat: add file preview modal (#945)

This commit is contained in:
Aman Harwara
2022-03-24 00:13:44 +05:30
committed by GitHub
parent 8715a8b8f4
commit 12e3bb0959
15 changed files with 445 additions and 135 deletions

View 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;
};