mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-18 11:51:41 +03:00
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 />;
|
||
|
};
|