clean up text preview support which was removed earlier (#3251)

This commit is contained in:
Prakash Senthil Vel
2024-02-28 22:30:41 +05:30
committed by GitHub
parent 8dd6dd4e7f
commit 2b6c3debb4
2 changed files with 1 additions and 18 deletions

View File

@@ -113,9 +113,6 @@ const PreviewFile = ({
"&.image": {
height: 500,
},
"&.text": {
height: 700,
},
"&.audio": {
height: 150,
},

View File

@@ -194,13 +194,7 @@ class BrowserDownload {
}
}
export type AllowedPreviews =
| "image"
| "pdf"
| "text"
| "audio"
| "video"
| "none";
export type AllowedPreviews = "image" | "pdf" | "audio" | "video" | "none";
export const contentTypePreview = (contentType: string): AllowedPreviews => {
if (contentType) {
const mimeObjectType = (contentType || "").toLowerCase();
@@ -211,9 +205,6 @@ export const contentTypePreview = (contentType: string): AllowedPreviews => {
if (mimeObjectType.includes("pdf")) {
return "pdf";
}
if (mimeObjectType.includes("text")) {
return "text";
}
if (mimeObjectType.includes("audio")) {
return "audio";
}
@@ -243,7 +234,6 @@ export const extensionPreview = (fileName: string): AllowedPreviews => {
"png",
"heic",
];
const textExtensions = ["txt"];
const pdfExtensions = ["pdf"];
const audioExtensions = ["wav", "mp3", "alac", "aiff", "dsd", "pcm"];
const videoExtensions = [
@@ -275,10 +265,6 @@ export const extensionPreview = (fileName: string): AllowedPreviews => {
return "pdf";
}
if (textExtensions.includes(fileExtension)) {
return "text";
}
if (audioExtensions.includes(fileExtension)) {
return "audio";
}