{children} diff --git a/client/src/components/Chat/TemporaryChat.tsx b/client/src/components/Chat/TemporaryChat.tsx index 75799516c0..a134379497 100644 --- a/client/src/components/Chat/TemporaryChat.tsx +++ b/client/src/components/Chat/TemporaryChat.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { motion } from 'framer-motion'; import { TooltipAnchor } from '@librechat/client'; import { MessageCircleDashed } from 'lucide-react'; import { useRecoilState, useRecoilCallback } from 'recoil'; @@ -42,7 +43,6 @@ export function TemporaryChat() { diff --git a/client/src/components/Conversations/Conversations.tsx b/client/src/components/Conversations/Conversations.tsx index 64b804b2d6..3a04f558f9 100644 --- a/client/src/components/Conversations/Conversations.tsx +++ b/client/src/components/Conversations/Conversations.tsx @@ -1,62 +1,22 @@ -import { useMemo, memo, type FC, useCallback, useEffect, useRef } from 'react'; +import { useMemo, memo, type FC, useCallback } from 'react'; import throttle from 'lodash/throttle'; -import { ChevronDown } from 'lucide-react'; -import { useRecoilValue } from 'recoil'; import { Spinner, useMediaQuery } from '@librechat/client'; import { List, AutoSizer, CellMeasurer, CellMeasurerCache } from 'react-virtualized'; -import type { TConversation } from 'librechat-data-provider'; -import { useLocalize, TranslationKeys, useFavorites, useShowMarketplace } from '~/hooks'; -import FavoritesList from '~/components/Nav/Favorites/FavoritesList'; -import { groupConversationsByDate, cn } from '~/utils'; +import { TConversation } from 'librechat-data-provider'; +import { useLocalize, TranslationKeys } from '~/hooks'; +import { groupConversationsByDate } from '~/utils'; import Convo from './Convo'; -import store from '~/store'; - -export type CellPosition = { - columnIndex: number; - rowIndex: number; -}; - -export type MeasuredCellParent = { - invalidateCellSizeAfterRender?: ((cell: CellPosition) => void) | undefined; - recomputeGridSize?: ((cell: CellPosition) => void) | undefined; -}; interface ConversationsProps { conversations: Array; moveToTop: () => void; toggleNav: () => void; - containerRef: React.RefObject; + containerRef: React.RefObject; loadMoreConversations: () => void; isLoading: boolean; isSearchLoading: boolean; - isChatsExpanded: boolean; - setIsChatsExpanded: (expanded: boolean) => void; } -interface MeasuredRowProps { - cache: CellMeasurerCache; - rowKey: string; - parent: MeasuredCellParent; - index: number; - style: React.CSSProperties; - children: React.ReactNode; -} - -/** Reusable wrapper for virtualized row measurement */ -const MeasuredRow: FC = memo( - ({ cache, rowKey, parent, index, style, children }) => ( - - {({ registerChild }) => ( -
} style={style}> - {children} -
- )} -
- ), -); - -MeasuredRow.displayName = 'MeasuredRow'; - const LoadingSpinner = memo(() => { const localize = useLocalize(); @@ -68,49 +28,18 @@ const LoadingSpinner = memo(() => { ); }); -LoadingSpinner.displayName = 'LoadingSpinner'; - -interface ChatsHeaderProps { - isExpanded: boolean; - onToggle: () => void; -} - -/** Collapsible header for the Chats section */ -const ChatsHeader: FC = memo(({ isExpanded, onToggle }) => { +const DateLabel: FC<{ groupName: string }> = memo(({ groupName }) => { const localize = useLocalize(); return ( - - ); -}); - -ChatsHeader.displayName = 'ChatsHeader'; - -const DateLabel: FC<{ groupName: string; isFirst?: boolean }> = memo(({ groupName, isFirst }) => { - const localize = useLocalize(); - return ( -

+
{localize(groupName as TranslationKeys) || groupName} -

+