quivr/frontend/app/chat/[chatId]/page.tsx
Mamadou DICKO e1a740472f
Feat: chat name edit (#343)
* feat(chat): add name update

* chore(linting): add flake8

* feat: add chat name edit
2023-06-20 09:54:23 +02:00

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