mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
refactor(Nav/Conversation): reorganize imports and fix import paths
This commit is contained in:
parent
4898f7489b
commit
dd8bc39001
10 changed files with 42 additions and 25 deletions
|
|
@ -1,11 +1,18 @@
|
||||||
import Conversation from './Conversation';
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
{conversations &&
|
{conversations &&
|
||||||
conversations.length > 0 &&
|
conversations.length > 0 &&
|
||||||
conversations.map((convo) => {
|
conversations.map((convo: TConversation) => {
|
||||||
return (
|
return (
|
||||||
<Conversation key={convo.conversationId} conversation={convo} retainView={moveToTop} />
|
<Conversation key={convo.conversationId} conversation={convo} retainView={moveToTop} />
|
||||||
);
|
);
|
||||||
5
client/src/components/Conversations/index.ts
Normal file
5
client/src/components/Conversations/index.ts
Normal file
|
|
@ -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';
|
||||||
2
client/src/components/Nav/ExportConversation/index.ts
Normal file
2
client/src/components/Nav/ExportConversation/index.ts
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
export { default as ExportConversation } from './ExportConversation';
|
||||||
|
export { default as ExportModel } from './ExportModel';
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { forwardRef } from 'react';
|
import { forwardRef } from 'react';
|
||||||
import LogOutIcon from '../svg/LogOutIcon';
|
import { LogOutIcon } from '../svg';
|
||||||
import { useAuthContext } from '~/hooks/AuthContext';
|
import { useAuthContext } from '~/hooks/AuthContext';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import store from '~/store';
|
import store from '~/store';
|
||||||
|
|
|
||||||
|
|
@ -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 { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { useGetConversationsQuery, useSearchQuery } from '@librechat/data-provider';
|
import { useGetConversationsQuery, useSearchQuery } from '@librechat/data-provider';
|
||||||
import { useRecoilValue, useSetRecoilState } from 'recoil';
|
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 { useAuthContext, useDebounce } from '~/hooks';
|
||||||
import store from '~/store';
|
|
||||||
import { localize } from '~/localization/Translation';
|
import { localize } from '~/localization/Translation';
|
||||||
|
import { cn } from '~/utils/';
|
||||||
|
import store from '~/store';
|
||||||
|
|
||||||
export default function Nav({ navVisible, setNavVisible }) {
|
export default function Nav({ navVisible, setNavVisible }) {
|
||||||
const [isHovering, setIsHovering] = useState(false);
|
const [isHovering, setIsHovering] = useState(false);
|
||||||
|
|
@ -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 { Download } from 'lucide-react';
|
||||||
import NavLink from './NavLink';
|
import { useRecoilValue } from 'recoil';
|
||||||
import ExportModel from './ExportConversation/ExportModel';
|
import { Fragment, useState } from 'react';
|
||||||
import ClearConvos from './ClearConvos';
|
import { Menu, Transition } from '@headlessui/react';
|
||||||
import Logout from './Logout';
|
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 { useAuthContext } from '~/hooks/AuthContext';
|
||||||
import { cn } from '~/utils/';
|
import { cn } from '~/utils/';
|
||||||
|
|
||||||
import store from '~/store';
|
import store from '~/store';
|
||||||
import { LinkIcon, DotsIcon, GearIcon, TrashIcon } from '~/components';
|
|
||||||
import { localize } from '~/localization/Translation';
|
|
||||||
|
|
||||||
export default function NavLinks({ clearSearch, isSearchEnabled }) {
|
export default function NavLinks({ clearSearch, isSearchEnabled }) {
|
||||||
const [showExports, setShowExports] = useState(false);
|
const [showExports, setShowExports] = useState(false);
|
||||||
|
|
|
||||||
11
client/src/components/Nav/index.ts
Normal file
11
client/src/components/Nav/index.ts
Normal file
|
|
@ -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';
|
||||||
|
|
@ -5,6 +5,7 @@ export { default as Panel } from './Panel';
|
||||||
export { default as Spinner } from './Spinner';
|
export { default as Spinner } from './Spinner';
|
||||||
export { default as Clipboard } from './Clipboard';
|
export { default as Clipboard } from './Clipboard';
|
||||||
export { default as CheckMark } from './CheckMark';
|
export { default as CheckMark } from './CheckMark';
|
||||||
|
export { default as LogOutIcon } from './LogOutIcon';
|
||||||
export { default as MessagesSquared } from './MessagesSquared';
|
export { default as MessagesSquared } from './MessagesSquared';
|
||||||
export { default as StopGeneratingIcon } from './StopGeneratingIcon';
|
export { default as StopGeneratingIcon } from './StopGeneratingIcon';
|
||||||
export { default as GoogleIcon } from './GoogleIcon';
|
export { default as GoogleIcon } from './GoogleIcon';
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,11 @@ import {
|
||||||
} from '@librechat/data-provider';
|
} from '@librechat/data-provider';
|
||||||
|
|
||||||
import MessageHandler from '../components/MessageHandler';
|
import MessageHandler from '../components/MessageHandler';
|
||||||
import MobileNav from '../components/Nav/MobileNav';
|
import { Nav, MobileNav } from '../components/Nav';
|
||||||
import Nav from '../components/Nav';
|
|
||||||
import { Outlet } from 'react-router-dom';
|
import { Outlet } from 'react-router-dom';
|
||||||
import store from '~/store';
|
|
||||||
import { useAuthContext } from '~/hooks/AuthContext';
|
import { useAuthContext } from '~/hooks/AuthContext';
|
||||||
import { useSetRecoilState } from 'recoil';
|
import { useSetRecoilState } from 'recoil';
|
||||||
|
import store from '~/store';
|
||||||
|
|
||||||
export default function Root() {
|
export default function Root() {
|
||||||
const [navVisible, setNavVisible] = useState(() => {
|
const [navVisible, setNavVisible] = useState(() => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue