diff --git a/surfsense_web/components/assistant-ui/document-upload-popup.tsx b/surfsense_web/components/assistant-ui/document-upload-popup.tsx index 32708cee3..1c18379f4 100644 --- a/surfsense_web/components/assistant-ui/document-upload-popup.tsx +++ b/surfsense_web/components/assistant-ui/document-upload-popup.tsx @@ -120,7 +120,12 @@ const DocumentUploadPopupContent: FC<{ return ( - + e.preventDefault()} + onInteractOutside={(e) => e.preventDefault()} + onEscapeKeyDown={(e) => e.preventDefault()} + className="select-none max-w-4xl w-[95vw] sm:w-full h-[calc(100dvh-2rem)] sm:h-[85vh] flex flex-col p-0 gap-0 overflow-hidden border border-border ring-0 bg-muted dark:bg-muted text-foreground [&>button]:right-3 sm:[&>button]:right-12 [&>button]:top-3 sm:[&>button]:top-10 [&>button]:opacity-80 hover:[&>button]:opacity-100 [&>button]:z-[100] [&>button_svg]:size-4 sm:[&>button_svg]:size-5" + > Upload Document {/* Scrollable container for mobile */} diff --git a/surfsense_web/components/sources/DocumentUploadTab.tsx b/surfsense_web/components/sources/DocumentUploadTab.tsx index cae78f7b7..29925a555 100644 --- a/surfsense_web/components/sources/DocumentUploadTab.tsx +++ b/surfsense_web/components/sources/DocumentUploadTab.tsx @@ -2,7 +2,7 @@ import { useAtom } from "jotai"; import { CheckCircle2, FileType, Info, Upload, X } from "lucide-react"; -import { AnimatePresence, motion } from "motion/react"; + import { useTranslations } from "next-intl"; import { useCallback, useMemo, useRef, useState } from "react"; import { useDropzone } from "react-dropzone"; @@ -241,12 +241,7 @@ export function DocumentUploadTab({ }; return ( - +
@@ -287,14 +282,10 @@ export function DocumentUploadTab({
) : isDragActive ? ( - +

{t("drop_files")}

- +
) : (
@@ -329,124 +320,102 @@ export function DocumentUploadTab({ - - {files.length > 0 && ( - - - -
-
- - {t("selected_files", { count: files.length })} - - - {t("total_size")}: {formatFileSize(totalFileSize)} - + {files.length > 0 && ( + + +
+
+ + {t("selected_files", { count: files.length })} + + + {t("total_size")}: {formatFileSize(totalFileSize)} + +
+ +
+
+ +
+ {files.map((file, index) => ( +
+
+ +
+

{file.name}

+
+ + {formatFileSize(file.size)} + + + {file.type || "Unknown type"} + +
+
- - -
- - {files.map((file, index) => ( - -
- -
-

{file.name}

-
- - {formatFileSize(file.size)} - - - {file.type || "Unknown type"} - -
-
-
- -
- ))} -
-
+ ))} +
- {isUploading && ( - - -
-
- {t("uploading_files")} - {Math.round(uploadProgress)}% -
- -
-
+ {isUploading && ( +
+ +
+
+ {t("uploading_files")} + {Math.round(uploadProgress)}% +
+ +
+
+ )} + +
+ +
+ +
+ - - - - - )} - + +
+
+
+ )} - +
); }