From f74e2c9da1c51ec774492a44a686173d7ffa54d2 Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Tue, 16 Sep 2025 14:50:58 +0530 Subject: [PATCH] (feat:filepciker) load inside table, ui --- frontend/src/components/FilePicker.tsx | 26 +++++++------------------- frontend/src/components/Table.tsx | 6 +++--- frontend/src/upload/Upload.tsx | 24 ++++++++++++++---------- 3 files changed, 24 insertions(+), 32 deletions(-) diff --git a/frontend/src/components/FilePicker.tsx b/frontend/src/components/FilePicker.tsx index fad833fb..c31c4e62 100644 --- a/frontend/src/components/FilePicker.tsx +++ b/frontend/src/components/FilePicker.tsx @@ -359,7 +359,7 @@ export const FilePicker: React.FC = ({
-
+
{/* Breadcrumb navigation */}
@@ -396,7 +396,7 @@ export const FilePicker: React.FC = ({ {/* Selected Files Message */}
- {selectedFiles.length} file(s) selected + {selectedFiles.length + selectedFolders.length} selected
@@ -407,18 +407,7 @@ export const FilePicker: React.FC = ({ className="scrollbar-thin md:w-4xl lg:w-5xl" bordered={false} > - {isLoading && files.length === 0 ? ( -
-
-
- Loading files... -
-
- ) : files.length === 0 ? ( -
- No files found in your {getProviderConfig(provider).displayName} -
- ) : ( + {( <> @@ -433,7 +422,6 @@ export const FilePicker: React.FC = ({ {files.map((file, index) => ( { if (isFolder(file)) { handleFolderClick(file.id, file.name); @@ -444,7 +432,7 @@ export const FilePicker: React.FC = ({ >
{ e.stopPropagation(); handleFileSelect(file.id, isFolder(file)); @@ -471,10 +459,10 @@ export const FilePicker: React.FC = ({ {file.name}
- + {formatDate(file.modifiedTime)} - + {file.size ? formatBytes(file.size) : '-'}
@@ -482,7 +470,7 @@ export const FilePicker: React.FC = ({
- {isLoading && files.length > 0 && ( + {isLoading && (
diff --git a/frontend/src/components/Table.tsx b/frontend/src/components/Table.tsx index 6eb49349..54aba156 100644 --- a/frontend/src/components/Table.tsx +++ b/frontend/src/components/Table.tsx @@ -44,7 +44,7 @@ const TableContainer = React.forwardRef(({
= ({ children, className = '' }) => { }; const TableRow: React.FC = ({ children, className = '', onClick }) => { - const baseClasses = "border-b border-[#EEE6FF78] hover:bg-[#ECEEEF] dark:border-[#6A6A6A] dark:hover:bg-[#27282D]"; + const baseClasses = "border-b border-[#D7D7D7] hover:bg-[#ECEEEF] dark:border-[#6A6A6A] dark:hover:bg-[#27282D]"; const cursorClass = onClick ? "cursor-pointer" : ""; return ( @@ -117,7 +117,7 @@ const TableHeader: React.FC = ({ } }; - const baseClasses = `px-2 py-3 text-sm font-medium text-gray-700 lg:px-3 dark:text-[#59636E] border-t border-b border-[#EEE6FF78] dark:border-[#6A6A6A] relative box-border ${getAlignmentClass()}`; + const baseClasses = `px-2 py-3 text-sm font-medium text-gray-700 lg:px-3 dark:text-[#59636E] border-t border-b border-[#D7D7D7] dark:border-[#6A6A6A] relative box-border ${getAlignmentClass()}`; const widthClasses = minWidth ? minWidth : ''; return ( diff --git a/frontend/src/upload/Upload.tsx b/frontend/src/upload/Upload.tsx index e6914ebe..fe675330 100644 --- a/frontend/src/upload/Upload.tsx +++ b/frontend/src/upload/Upload.tsx @@ -259,13 +259,13 @@ function Upload({ const { t } = useTranslation(); const setTimeoutRef = useRef(null); - const ingestorOptions: { label: string; value: IngestorType; icon: string }[] = [ - { label: 'Upload File', value: 'local_file', icon: FileUploadIcon }, - { label: 'Crawler', value: 'crawler', icon: CrawlerIcon }, - { label: 'Link', value: 'url', icon: UrlIcon }, - { label: 'GitHub', value: 'github', icon: GithubIcon }, - { label: 'Reddit', value: 'reddit', icon: RedditIcon }, - { label: 'Google Drive', value: 'google_drive', icon: DriveIcon }, + const ingestorOptions: { label: string; value: IngestorType; icon: string; heading: string }[] = [ + { label: 'Upload File', value: 'local_file', icon: FileUploadIcon, heading: 'Upload new document' }, + { label: 'Crawler', value: 'crawler', icon: CrawlerIcon, heading: 'Add content with Web Crawler' }, + { label: 'Link', value: 'url', icon: UrlIcon, heading: 'Add content from URL' }, + { label: 'GitHub', value: 'github', icon: GithubIcon, heading: 'Add content from GitHub' }, + { label: 'Reddit', value: 'reddit', icon: RedditIcon, heading: 'Add content from Reddit' }, + { label: 'Google Drive', value: 'google_drive', icon: DriveIcon, heading: 'Upload from Google Drive' }, ]; const sourceDocs = useSelector(selectSourceDocs); @@ -672,11 +672,11 @@ function Upload({ const renderIngestorSelection = () => { return ( -
+
{ingestorOptions.map((option) => (
Back +

+ {ingestor.type && ingestorOptions.find(option => option.value === ingestor.type)?.heading} +

+ {renderFormFields()}