quivr/frontend/app/chat/[chatId]/components/ChatDialogueArea/ChatDialogue.tsx
Stan Girard d0b8b797f6
feat(search): new way to interact with Quivr (#2026)
Co-authored-by: Zewed <dewez.antoine2@gmail.com>
Co-authored-by: Antoine Dewez <44063631+Zewed@users.noreply.github.com>
2024-01-19 20:34:30 -08:00

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 <></>;
};