2023-09-12 18:44:15 +03:00
|
|
|
import { useChatContext } from "@/lib/context";
|
2023-10-26 16:41:12 +03:00
|
|
|
import { useOnboarding } from "@/lib/hooks/useOnboarding";
|
2023-09-12 18:44:15 +03:00
|
|
|
|
|
|
|
import { ChatDialogue } from "./components/ChatDialogue";
|
|
|
|
import { getMergedChatMessagesWithDoneStatusNotificationsReduced } from "./utils/getMergedChatMessagesWithDoneStatusNotificationsReduced";
|
|
|
|
|
|
|
|
export const ChatDialogueArea = (): JSX.Element => {
|
|
|
|
const { messages, notifications } = useChatContext();
|
|
|
|
|
|
|
|
const chatItems = getMergedChatMessagesWithDoneStatusNotificationsReduced(
|
|
|
|
messages,
|
|
|
|
notifications
|
|
|
|
);
|
2023-10-26 16:41:12 +03:00
|
|
|
const { isOnboarding } = useOnboarding();
|
2023-09-12 18:44:15 +03:00
|
|
|
|
2023-10-26 16:41:12 +03:00
|
|
|
const shouldDisplayShortcuts = chatItems.length === 0 && !isOnboarding;
|
2023-09-12 18:44:15 +03:00
|
|
|
|
|
|
|
if (!shouldDisplayShortcuts) {
|
|
|
|
return <ChatDialogue chatItems={chatItems} />;
|
|
|
|
}
|
|
|
|
|
2024-01-20 07:34:30 +03:00
|
|
|
return <></>;
|
2023-09-12 18:44:15 +03:00
|
|
|
};
|