From 6fdea4b5ef95a23fc5822f932bceeab41cb7fd07 Mon Sep 17 00:00:00 2001 From: Aayush Agnihotri Date: Sun, 29 Dec 2024 00:06:20 -0500 Subject: [PATCH] Fixing types --- src/app/components/InitialChatPage.tsx | 31 ++++++++++++---------- src/app/components/chat/ChatMenuNavbar.tsx | 6 ++--- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/app/components/InitialChatPage.tsx b/src/app/components/InitialChatPage.tsx index 1d19129..481fa03 100644 --- a/src/app/components/InitialChatPage.tsx +++ b/src/app/components/InitialChatPage.tsx @@ -41,22 +41,25 @@ export default function InitialChatPage() { }; return ( -
- - -
- -
- {`Hello, ${firstName}`} - - How can I help you today? - -
+ <> +
+ + +
+ +
+ {`Hello, ${firstName}`} + + How can I help you today? + +
-
- +
+ +
-
+ + ); } diff --git a/src/app/components/chat/ChatMenuNavbar.tsx b/src/app/components/chat/ChatMenuNavbar.tsx index 09c68d6..632ed83 100644 --- a/src/app/components/chat/ChatMenuNavbar.tsx +++ b/src/app/components/chat/ChatMenuNavbar.tsx @@ -1,6 +1,6 @@ import { useAuth } from '@/contexts/AuthContext'; import { useState, useEffect, useRef } from 'react'; -import { Chats } from '@/types/chat'; +import { Chat } from '@prisma/client'; import { useRouter } from 'next/navigation'; import Image from 'next/image'; import Spinner from '../Spinner'; @@ -16,7 +16,7 @@ export default function ChatMenuNavbar() { const [isNavbarOpen, setIsNavbarOpen] = useState(!(window.innerWidth < 768)); const [isEmbedModalOpen, setIsEmbedModalOpen] = useState(false); const [isModelModalOpen, setIsModelModalOpen] = useState(false); - const [chatHistory, setChatHistory] = useState({ chats: [] }); + const [chatHistory, setChatHistory] = useState([]); const [loadingHistory, setLoadingHistory] = useState(true); const router = useRouter(); const menuRef = useRef(null); @@ -155,7 +155,7 @@ export default function ChatMenuNavbar() {
) : (
- {chatHistory.chats.map((chat, index) => ( + {chatHistory.map((chat, index) => ( ))}