mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-19 17:01:41 +03:00
e1a740472f
* feat(chat): add name update * chore(linting): add flake8 * feat: add chat name edit
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
/* eslint-disable */
|
|
"use client";
|
|
import { UUID } from "crypto";
|
|
import { useEffect } from "react";
|
|
|
|
import PageHeading from "@/lib/components/ui/PageHeading";
|
|
import useChatsContext from "@/lib/context/ChatsProvider/hooks/useChatsContext";
|
|
|
|
import { ChatInput, ChatMessages } from "../components";
|
|
|
|
interface ChatPageProps {
|
|
params: {
|
|
chatId: UUID;
|
|
};
|
|
}
|
|
|
|
export default function ChatPage({ params }: ChatPageProps) {
|
|
const chatId: UUID | undefined = params.chatId;
|
|
|
|
const { fetchChat, resetChat } = useChatsContext();
|
|
|
|
useEffect(() => {
|
|
if (!chatId) {
|
|
resetChat();
|
|
}
|
|
fetchChat(chatId);
|
|
}, []);
|
|
|
|
return (
|
|
<main className="flex flex-col w-full pt-10">
|
|
<section className="flex flex-col flex-1 items-center w-full h-full min-h-screen">
|
|
<PageHeading
|
|
title="Chat with your brain"
|
|
subtitle="Talk to a language model about your uploaded data"
|
|
/>
|
|
<div className="relative h-full w-full flex flex-col flex-1 items-center">
|
|
<div className="h-full flex-1 w-full flex flex-col items-center">
|
|
<ChatMessages />
|
|
</div>
|
|
<ChatInput />
|
|
</div>
|
|
</section>
|
|
</main>
|
|
);
|
|
}
|