diff --git a/frontend/src/documents/DocumentsTable.jsx b/frontend/src/documents/DocumentsTable.jsx index 1806e2c..86a3c1b 100644 --- a/frontend/src/documents/DocumentsTable.jsx +++ b/frontend/src/documents/DocumentsTable.jsx @@ -258,6 +258,13 @@ const DocumentsTable = ({ [onClearSelection], ); + const showDefaultEmptyState = !showingSearchResults && !subfolders.length && rows.length === 0; + const showListSearchEmptyState = + showingSearchResults && rows.length === 0 && !isGridView && !isSearchLoading; + const showGridSearchEmptyState = + isGridView && showingSearchResults && rows.length === 0 && !isSearchLoading; + const showSearchHint = showingSearchResults && rows.length > 0; + return (
+ {showDefaultEmptyState && ( +
+ Drop files anywhere or onto a folder to upload documents. +
+ )} + {showGridSearchEmptyState && ( +
+ No documents match the current filters. +
+ )}
- {!showingSearchResults && !subfolders.length && rows.length === 0 ? ( -
- Drop files anywhere or onto a folder to upload documents. -
- ) : isGridView ? ( + {showDefaultEmptyState ? null : isGridView ? (
)}
- {rows.length === 0 && showingSearchResults && !isGridView && !isSearchLoading && ( + {showListSearchEmptyState && (
No documents match the current filters.
)} - {showingSearchResults && rows.length > 0 && ( + {showSearchHint && (
Showing {rows.length} document{rows.length === 1 ? '' : 's'} in {currentFolderName} and subfolders.
)}
- {isGridView && showingSearchResults && rows.length === 0 && !isSearchLoading && ( -
- No documents match the current filters. -
- )}
); -}; +}; export default DocumentsTable; export { DocumentThumbnailImage };