2023-06-11 00:59:16 +03:00
|
|
|
"use client";
|
2023-06-15 12:52:46 +03:00
|
|
|
|
2023-09-29 11:24:31 +03:00
|
|
|
import { useKnowledgeToFeedContext } from "@/lib/context/KnowledgeToFeedProvider/hooks/useKnowledgeToFeedContext";
|
2023-09-28 12:29:55 +03:00
|
|
|
import { useCustomDropzone } from "@/lib/hooks/useDropzone";
|
2023-12-14 18:22:09 +03:00
|
|
|
import { cn } from "@/lib/utils";
|
2023-09-28 12:29:55 +03:00
|
|
|
|
2023-08-11 11:06:20 +03:00
|
|
|
import { ActionsBar } from "./components/ActionsBar";
|
2023-09-12 18:44:15 +03:00
|
|
|
import { ChatDialogueArea } from "./components/ChatDialogueArea/ChatDialogue";
|
2023-12-14 18:22:09 +03:00
|
|
|
import { useChatNotificationsSync } from "./hooks/useChatNotificationsSync";
|
|
|
|
import { useChatsList } from "./hooks/useChatsList";
|
2023-06-11 00:59:16 +03:00
|
|
|
|
2023-07-05 19:33:18 +03:00
|
|
|
const SelectedChatPage = (): JSX.Element => {
|
2024-01-14 01:52:21 +03:00
|
|
|
const { getRootProps } = useCustomDropzone();
|
|
|
|
const { shouldDisplayFeedCard } = useKnowledgeToFeedContext();
|
2023-12-14 18:22:09 +03:00
|
|
|
|
2024-01-14 01:52:21 +03:00
|
|
|
useChatsList();
|
|
|
|
useChatNotificationsSync();
|
2023-09-27 16:39:04 +03:00
|
|
|
|
2024-01-14 01:52:21 +03:00
|
|
|
return (
|
|
|
|
<div className="flex flex-1">
|
|
|
|
<div
|
|
|
|
className={cn(
|
|
|
|
"flex flex-col flex-1 items-center justify-stretch w-full h-full overflow-hidden",
|
|
|
|
shouldDisplayFeedCard ? "bg-chat-bg-gray" : "bg-tertiary",
|
|
|
|
"dark:bg-black transition-colors ease-out duration-500"
|
|
|
|
)}
|
|
|
|
data-testid="chat-page"
|
|
|
|
{...getRootProps()}
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
className={`flex flex-col flex-1 w-full max-w-4xl h-full dark:shadow-primary/25 overflow-hidden p-2 sm:p-4 md:p-6 lg:p-8`}
|
|
|
|
>
|
|
|
|
<div className="flex flex-1 flex-col overflow-y-auto">
|
|
|
|
<ChatDialogueArea />
|
|
|
|
</div>
|
|
|
|
<ActionsBar />
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-08-11 11:06:20 +03:00
|
|
|
</div>
|
2024-01-14 01:52:21 +03:00
|
|
|
);
|
2023-07-05 10:30:22 +03:00
|
|
|
};
|
|
|
|
|
2023-07-05 19:33:18 +03:00
|
|
|
export default SelectedChatPage;
|