+
+ {renderPathNavigation()}
+
+
+ {renderFileSearch && (
+ renderFileSearch()
+ )}
-
- {editModal.chunk && (
-
- setEditModal((prev) => ({ ...prev, state }))
- }
- handleSubmit={(title, text) => {
- handleUpdateChunk(title, text, editModal.chunk as ChunkType);
- }}
- originalText={editModal.chunk?.text ?? ''}
- originalTitle={editModal.chunk?.metadata?.title ?? ''}
- handleDelete={() => {
- handleDeleteChunk(editModal.chunk as ChunkType);
- }}
- />
- )}
-
- );
+ {/* Right side: Chunks content */}
+
+
+
+
+ {totalChunks > 999999
+ ? `${(totalChunks / 1000000).toFixed(2)}M`
+ : totalChunks > 999
+ ? `${(totalChunks / 1000).toFixed(2)}K`
+ : totalChunks} {t('settings.documents.chunks')}
+
+
+
+ setSearchTerm(e.target.value)}
+ className="w-full h-full px-3 py-2 bg-transparent border-none outline-none font-normal text-[13.56px] leading-[100%] dark:text-[#E0E0E0]"
+ />
+
+
+
+
+ {loading ? (
+
+
+
+ ) : (
+
+ {filteredChunks.length === 0 ? (
+
+

+ {t('settings.documents.noChunks')}
+
+ ) : (
+ filteredChunks.map((chunk, index) => (
+
+
+
+
+ {chunk.metadata.token_count ? chunk.metadata.token_count.toLocaleString() : '-'} tokens
+
+
+
+
+
+
+ ))
+ )}
+
+ )}
+
+ {!loading && filteredChunks.length > 0 && (
+
{
+ setPerPage(rows);
+ setPage(1);
+ }}
+ />
+ )}
+
+
+ {editModal.chunk && (
+
+ setEditModal((prev) => ({ ...prev, state }))
+ }
+ handleSubmit={(title, text) => {
+ handleUpdateChunk(title, text, editModal.chunk as ChunkType);
+ }}
+ originalText={editModal.chunk?.text ?? ''}
+ originalTitle={editModal.chunk?.metadata?.title ?? ''}
+ handleDelete={() => {
+ handleDeleteChunk(editModal.chunk as ChunkType);
+ }}
+ />
+ )}
+
+
+