mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-16 18:52:12 +03:00
d0b8b797f6
Co-authored-by: Zewed <dewez.antoine2@gmail.com> Co-authored-by: Antoine Dewez <44063631+Zewed@users.noreply.github.com>
24 lines
758 B
TypeScript
24 lines
758 B
TypeScript
import { useChatContext } from "@/lib/context";
|
|
import { useOnboarding } from "@/lib/hooks/useOnboarding";
|
|
|
|
import { ChatDialogue } from "./components/ChatDialogue";
|
|
import { getMergedChatMessagesWithDoneStatusNotificationsReduced } from "./utils/getMergedChatMessagesWithDoneStatusNotificationsReduced";
|
|
|
|
export const ChatDialogueArea = (): JSX.Element => {
|
|
const { messages, notifications } = useChatContext();
|
|
|
|
const chatItems = getMergedChatMessagesWithDoneStatusNotificationsReduced(
|
|
messages,
|
|
notifications
|
|
);
|
|
const { isOnboarding } = useOnboarding();
|
|
|
|
const shouldDisplayShortcuts = chatItems.length === 0 && !isOnboarding;
|
|
|
|
if (!shouldDisplayShortcuts) {
|
|
return <ChatDialogue chatItems={chatItems} />;
|
|
}
|
|
|
|
return <></>;
|
|
};
|