feat: replaced select source modal with hook to set default doc

This commit is contained in:
Siddhant Rai
2024-08-05 22:28:58 +05:30
parent 22b7445ac4
commit 51553c565f
3 changed files with 32 additions and 124 deletions

View File

@@ -22,6 +22,7 @@ import {
} from './conversation/conversationSlice';
import ConversationTile from './conversation/ConversationTile';
import { useDarkTheme, useMediaQuery, useOutsideAlerter } from './hooks';
import useDefaultDocument from './hooks/useDefaultDocument';
import DeleteConvModal from './modals/DeleteConvModal';
import { ActiveState } from './models/misc';
import APIKeyModal from './preferences/APIKeyModal';
@@ -39,7 +40,6 @@ import {
setSelectedDocs,
setSourceDocs,
} from './preferences/preferenceSlice';
import SelectDocsModal from './preferences/SelectDocsModal';
import Upload from './upload/Upload';
interface NavigationProps {
@@ -192,6 +192,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
useEffect(() => {
setNavOpen(!isMobile);
}, [isMobile]);
useDefaultDocument();
return (
<>
{!navOpen && (
@@ -398,12 +399,6 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
/>
</button>
</div>
<SelectDocsModal
modalState={selectedDocsModalState}
setModalState={setSelectedDocsModalState}
isCancellable={isSelectedDocsSet}
/>
<APIKeyModal
modalState={apiKeyModalState}
setModalState={setApiKeyModalState}