+ {viewingFile && fileViewUrl && (
+ <>
+ {/* PDF Viewer */}
+ {viewingFile.mimeType === "application/pdf" && (
+
+
+
+ )}
+
+ {/* Image Viewer */}
+ {viewingFile.mimeType?.startsWith("image/") && (
+
+

+
+ )}
+
+ {/* Text/Code Viewer */}
+ {(viewingFile.mimeType?.startsWith("text/") ||
+ viewingFile.mimeType === "application/json" ||
+ viewingFile.mimeType === "application/javascript") && (
+
+ )}
+
+ {/* Unsupported file type */}
+ {!viewingFile.mimeType?.startsWith("image/") &&
+ viewingFile.mimeType !== "application/pdf" &&
+ !viewingFile.mimeType?.startsWith("text/") &&
+ viewingFile.mimeType !== "application/json" &&
+ viewingFile.mimeType !== "application/javascript" && (
+
+
+
+ Preview not available
+
+
+ This file type cannot be previewed
+
+
+
+ )}
+ >
+ )}
+