mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-17 19:32:47 +03:00
e2c1a027b0
Issue: https://github.com/StanGirard/quivr/issues/1888 - Add Spinner when history is loading - Change chat messages fetching logic - Add cha view new design Demo: https://github.com/StanGirard/quivr/assets/63923024/c4341ccf-bacd-4720-9aa1-127dd557a75c
47 lines
1.6 KiB
TypeScript
47 lines
1.6 KiB
TypeScript
"use client";
|
|
|
|
import { useMenuWidth } from "@/lib/components/Menu/hooks/useMenuWidth";
|
|
import { useKnowledgeToFeedContext } from "@/lib/context/KnowledgeToFeedProvider/hooks/useKnowledgeToFeedContext";
|
|
import { useCustomDropzone } from "@/lib/hooks/useDropzone";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
import { ActionsBar } from "./components/ActionsBar";
|
|
import { ChatDialogueArea } from "./components/ChatDialogueArea/ChatDialogue";
|
|
import { useChatNotificationsSync } from "./hooks/useChatNotificationsSync";
|
|
import { useChatsList } from "./hooks/useChatsList";
|
|
|
|
const SelectedChatPage = (): JSX.Element => {
|
|
const { getRootProps } = useCustomDropzone();
|
|
const { shouldDisplayFeedCard } = useKnowledgeToFeedContext();
|
|
const { staticMenuWidth } = useMenuWidth();
|
|
|
|
useChatsList();
|
|
useChatNotificationsSync();
|
|
|
|
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-5xl 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>
|
|
<div className="h-full bg-highlight" style={{ width: staticMenuWidth }} />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default SelectedChatPage;
|