Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

refactor(Nav/Conversation): reorganize imports and fix import paths

Danny Aviladd8bc3900155
diff --git a/client/src/components/Conversations/index.jsx b/client/src/components/Conversations/Conversations.tsx
similarity index 52%
rename from client/src/components/Conversations/index.jsx
rename to client/src/components/Conversations/Conversations.tsx
index 533539aa17..2ec0d14a75 100644
--- a/client/src/components/Conversations/index.jsx
+++ b/client/src/components/Conversations/Conversations.tsx
@@ -1,11 +1,18 @@
import Conversation from './Conversation';
+import { TConversation } from '@librechat/data-provider';
-export default function Conversations({ conversations, moveToTop }) {
+export default function Conversations({
+ conversations,
+ moveToTop,
+}: {
+ conversations: TConversation[];
+ moveToTop: () => void;
+}) {
return (
<>
{conversations &&
conversations.length > 0 &&
- conversations.map((convo) => {
+ conversations.map((convo: TConversation) => {
return (
<Conversation key={convo.conversationId} conversation={convo} retainView={moveToTop} />
);
diff --git a/client/src/components/Conversations/index.ts b/client/src/components/Conversations/index.ts
new file mode 100644
index 0000000000..272522617b
--- /dev/null
+++ b/client/src/components/Conversations/index.ts
@@ -0,0 +1,5 @@
+export { default as Pages } from './Pages';
+export { default as Conversation } from './Conversation';
+export { default as DeleteButton } from './DeleteButton';
+export { default as RenameButton } from './RenameButton';
+export { default as Conversations } from './Conversations';
diff --git a/client/src/components/Nav/ExportConversation/index.jsx b/client/src/components/Nav/ExportConversation/ExportConversation.jsx
similarity index 100%
rename from client/src/components/Nav/ExportConversation/index.jsx
rename to client/src/components/Nav/ExportConversation/ExportConversation.jsx
diff --git a/client/src/components/Nav/ExportConversation/index.ts b/client/src/components/Nav/ExportConversation/index.ts
new file mode 100644
index 0000000000..981cd0d32c
--- /dev/null
+++ b/client/src/components/Nav/ExportConversation/index.ts
@@ -0,0 +1,2 @@
+export { default as ExportConversation } from './ExportConversation';
+export { default as ExportModel } from './ExportModel';
diff --git a/client/src/components/Nav/Logout.jsx b/client/src/components/Nav/Logout.jsx
index cca2748ca0..f0e8e4751d 100644
--- a/client/src/components/Nav/Logout.jsx
+++ b/client/src/components/Nav/Logout.jsx
@@ -1,5 +1,5 @@
import { forwardRef } from 'react';
-import LogOutIcon from '../svg/LogOutIcon';
+import { LogOutIcon } from '../svg';
import { useAuthContext } from '~/hooks/AuthContext';
import { useRecoilValue } from 'recoil';
import store from '~/store';
diff --git a/client/src/components/Nav/index.jsx b/client/src/components/Nav/Nav.jsx
similarity index 97%
rename from client/src/components/Nav/index.jsx
rename to client/src/components/Nav/Nav.jsx
index 622656a572..216f5a896c 100644
--- a/client/src/components/Nav/index.jsx
+++ b/client/src/components/Nav/Nav.jsx
@@ -1,16 +1,13 @@
+import { NewChat, NavLinks } from './';
+import { Panel, Spinner } from '~/components';
+import { Conversations, Pages } from '../Conversations';
import { useCallback, useEffect, useRef, useState } from 'react';
import { useGetConversationsQuery, useSearchQuery } from '@librechat/data-provider';
import { useRecoilValue, useSetRecoilState } from 'recoil';
-
-import Conversations from '../Conversations';
-import NavLinks from './NavLinks';
-import NewChat from './NewChat';
-import Pages from '../Conversations/Pages';
-import { Panel, Spinner } from '~/components';
-import { cn } from '~/utils/';
import { useAuthContext, useDebounce } from '~/hooks';
-import store from '~/store';
import { localize } from '~/localization/Translation';
+import { cn } from '~/utils/';
+import store from '~/store';
export default function Nav({ navVisible, setNavVisible }) {
const [isHovering, setIsHovering] = useState(false);
diff --git a/client/src/components/Nav/NavLinks.jsx b/client/src/components/Nav/NavLinks.jsx
index 1391aafaea..4ea89a2824 100644
--- a/client/src/components/Nav/NavLinks.jsx
+++ b/client/src/components/Nav/NavLinks.jsx
@@ -1,19 +1,14 @@
-import { Menu, Transition } from '@headlessui/react';
-import { Fragment, useState } from 'react';
-import { useRecoilValue } from 'recoil';
-import SearchBar from './SearchBar';
-import Settings from './Settings';
import { Download } from 'lucide-react';
-import NavLink from './NavLink';
-import ExportModel from './ExportConversation/ExportModel';
-import ClearConvos from './ClearConvos';
-import Logout from './Logout';
+import { useRecoilValue } from 'recoil';
+import { Fragment, useState } from 'react';
+import { Menu, Transition } from '@headlessui/react';
+import { SearchBar, ClearConvos, Settings, NavLink, Logout, ExportModel } from './';
+import { LinkIcon, DotsIcon, GearIcon, TrashIcon } from '~/components';
+import { localize } from '~/localization/Translation';
import { useAuthContext } from '~/hooks/AuthContext';
import { cn } from '~/utils/';
import store from '~/store';
-import { LinkIcon, DotsIcon, GearIcon, TrashIcon } from '~/components';
-import { localize } from '~/localization/Translation';
export default function NavLinks({ clearSearch, isSearchEnabled }) {
const [showExports, setShowExports] = useState(false);
diff --git a/client/src/components/Nav/index.ts b/client/src/components/Nav/index.ts
new file mode 100644
index 0000000000..4a3de60076
--- /dev/null
+++ b/client/src/components/Nav/index.ts
@@ -0,0 +1,11 @@
+export * from './ExportConversation';
+export * from './SettingsTabs/';
+export { default as ClearConvos } from './ClearConvos';
+export { default as Logout } from './Logout';
+export { default as MobileNav } from './MobileNav';
+export { default as Nav } from './Nav';
+export { default as NavLink } from './NavLink';
+export { default as NavLinks } from './NavLinks';
+export { default as NewChat } from './NewChat';
+export { default as SearchBar } from './SearchBar';
+export { default as Settings } from './Settings';
diff --git a/client/src/components/svg/index.ts b/client/src/components/svg/index.ts
index aaa0812ae9..6a887b7b3e 100644
--- a/client/src/components/svg/index.ts
+++ b/client/src/components/svg/index.ts
@@ -5,6 +5,7 @@ export { default as Panel } from './Panel';
export { default as Spinner } from './Spinner';
export { default as Clipboard } from './Clipboard';
export { default as CheckMark } from './CheckMark';
+export { default as LogOutIcon } from './LogOutIcon';
export { default as MessagesSquared } from './MessagesSquared';
export { default as StopGeneratingIcon } from './StopGeneratingIcon';
export { default as GoogleIcon } from './GoogleIcon';
diff --git a/client/src/routes/Root.jsx b/client/src/routes/Root.jsx
index 83ab215803..26739a4c31 100644
--- a/client/src/routes/Root.jsx
+++ b/client/src/routes/Root.jsx
@@ -7,12 +7,11 @@ import {
} from '@librechat/data-provider';
import MessageHandler from '../components/MessageHandler';
-import MobileNav from '../components/Nav/MobileNav';
-import Nav from '../components/Nav';
+import { Nav, MobileNav } from '../components/Nav';
import { Outlet } from 'react-router-dom';
-import store from '~/store';
import { useAuthContext } from '~/hooks/AuthContext';
import { useSetRecoilState } from 'recoil';
+import store from '~/store';
export default function Root() {
const [navVisible, setNavVisible] = useState(() => {