diff --git a/client/src/components/Chat/ChatView.tsx b/client/src/components/Chat/ChatView.tsx index 27530a5c22..cceb268aae 100644 --- a/client/src/components/Chat/ChatView.tsx +++ b/client/src/components/Chat/ChatView.tsx @@ -3,11 +3,18 @@ import { useRecoilValue } from 'recoil'; import { useForm } from 'react-hook-form'; import { Spinner } from '@librechat/client'; import { useParams } from 'react-router-dom'; +import { Folder } from 'lucide-react'; import { Constants, buildTree } from 'librechat-data-provider'; -import type { TMessage } from 'librechat-data-provider'; +import type { TChatProject, TMessage } from 'librechat-data-provider'; import type { ChatFormValues } from '~/common'; import { ChatContext, AddedChatContext, ChatFormProvider, useFileMapContext } from '~/Providers'; -import { useAddedResponse, useResumeOnLoad, useAdaptiveSSE, useChatHelpers } from '~/hooks'; +import { + useAddedResponse, + useResumeOnLoad, + useAdaptiveSSE, + useChatHelpers, + useLocalize, +} from '~/hooks'; import ConversationStarters from './Input/ConversationStarters'; import { useGetMessagesByConvoId } from '~/data-provider'; import MessagesView from './Messages/MessagesView'; @@ -29,8 +36,27 @@ function LoadingSpinner() { ); } -function ChatView({ index = 0 }: { index?: number }) { +function ProjectLanding({ project }: { project: TChatProject }) { + return ( +
+
+
+
+ {project.description && ( +

{project.description}

+ )} +
+
+ ); +} + +function ChatView({ index = 0, project }: { index?: number; project?: TChatProject }) { const { conversationId } = useParams(); + const localize = useLocalize(); const rootSubmission = useRecoilValue(store.submissionByIndex(index)); const isSubmitting = useRecoilValue(store.isSubmittingFamily(index)); const centerFormOnLanding = useRecoilValue(store.centerFormOnLanding); @@ -70,6 +96,7 @@ function ChatView({ index = 0 }: { index?: number }) { (!messagesTree || messagesTree.length === 0) && (conversationId === Constants.NEW_CONVO || !conversationId); const isNavigating = (!messagesTree || messagesTree.length === 0) && conversationId != null; + const isProjectLandingPage = isLandingPage && project != null; if (isLoading && conversationId !== Constants.NEW_CONVO) { content = ; @@ -77,10 +104,17 @@ function ChatView({ index = 0 }: { index?: number }) { content = ; } else if (!isLandingPage) { content = ; + } else if (isProjectLandingPage && project) { + content = ; } else { content = ; } + const chatFormPlaceholder = + isProjectLandingPage && project + ? localize('com_ui_new_chat_in_project', { name: project.name }) + : undefined; + return ( @@ -104,7 +138,7 @@ function ChatView({ index = 0 }: { index?: number }) { isLandingPage && 'max-w-3xl transition-all duration-200 xl:max-w-4xl', )} > - + {isLandingPage ? :