mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-18 03:41:44 +03:00
10af0c949a
* feat: rename ChatMessages to MessagesDialog * feat: rename history to messages * feat: add notifications to ChatContext * feat: add getNotificationsFromChatHistory * feat: add getMergedChatHistoryWithReducedNotifications * refactor: update useActionBar * refactor: update <ChatMessage />-n * feat: update crawler and endpoint notifications content * feat: display notifications * test: update <MessageDialog /> tests * feat: rename ChatMessage to QADisplay * feat: rename ChatHistory to ChatMessage * feat(upload): throw error when file missing * feat: rename getMergedChatHistoryWithReducedNotifications to getMergedChatMessagesWithReducedNotifications * feat: change history wording to message * feat: move getFileIcon to lib * refactor(NotificationDisplayer): move types to types.ts * chore: improve ux * feat: rename MessagesDialog to ChatDialogue
23 lines
698 B
TypeScript
23 lines
698 B
TypeScript
import { useChatContext } from "@/lib/context";
|
|
|
|
import { ChatDialogue } from "./components/ChatDialogue";
|
|
import { ShortCuts } from "./components/ShortCuts";
|
|
import { getMergedChatMessagesWithDoneStatusNotificationsReduced } from "./utils/getMergedChatMessagesWithDoneStatusNotificationsReduced";
|
|
|
|
export const ChatDialogueArea = (): JSX.Element => {
|
|
const { messages, notifications } = useChatContext();
|
|
|
|
const chatItems = getMergedChatMessagesWithDoneStatusNotificationsReduced(
|
|
messages,
|
|
notifications
|
|
);
|
|
|
|
const shouldDisplayShortcuts = chatItems.length === 0;
|
|
|
|
if (!shouldDisplayShortcuts) {
|
|
return <ChatDialogue chatItems={chatItems} />;
|
|
}
|
|
|
|
return <ShortCuts />;
|
|
};
|