diff --git a/frontend/src/settings/Documents.tsx b/frontend/src/settings/Documents.tsx index 14ab2e87..9a8e4195 100644 --- a/frontend/src/settings/Documents.tsx +++ b/frontend/src/settings/Documents.tsx @@ -1,3 +1,4 @@ + import React, { useCallback, useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; @@ -94,23 +95,6 @@ export default function Documents({ setActiveMenuId(docId); }; - useEffect(() => { - const handleClickOutside = (event: MouseEvent) => { - if (activeMenuId) { - const activeRef = menuRefs.current[activeMenuId]; - if ( - activeRef?.current && - !activeRef.current.contains(event.target as Node) - ) { - setActiveMenuId(null); - } - } - }; - - document.addEventListener('mousedown', handleClickOutside); - return () => document.removeEventListener('mousedown', handleClickOutside); - }, [activeMenuId]); - const currentDocuments = paginatedDocuments ?? []; const syncOptions = [ { label: t('settings.documents.syncFrequency.never'), value: 'never' }, @@ -288,7 +272,7 @@ export default function Documents({ documentId={documentToView.id || ''} documentName={documentToView.name} handleGoBack={() => setDocumentToView(undefined)} - showHeader={false} + showHeader={true} /> )} @@ -345,19 +329,19 @@ export default function Documents({

) : ( -
- {currentDocuments.map((document, index) => { - const docId = document.id ? document.id.toString() : ''; +
+ {currentDocuments.map((document, index) => { + const docId = document.id ? document.id.toString() : ''; - return ( -
-
+ return ( +
+