"use client"; import PageHeading from "@/lib/components/ui/PageHeading"; import useChatsContext from "@/lib/context/ChatsProvider/hooks/useChatsContext"; import { UUID } from "crypto"; import { useEffect } from "react"; 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) if (!chatId) resetChat(); fetchChat(chatId); }, [fetchChat, chatId]); return (
); }