Skip to content

Commit 6fdea4b

Browse files
Fixing types
1 parent c7498c2 commit 6fdea4b

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

src/app/components/InitialChatPage.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,25 @@ export default function InitialChatPage() {
4141
};
4242

4343
return (
44-
<div className="flex h-svh flex-row gap-0">
45-
<ChatMenuNavbar />
46-
47-
<div className="flex w-full flex-col">
48-
<ChatHeader />
49-
<div className="m-auto mt-10 flex w-4/5 flex-grow flex-col gap-3">
50-
<span className="text-7xl font-semibold">{`Hello, ${firstName}`}</span>
51-
<span className="text-3xl font-semibold text-primaryColor">
52-
How can I help you today?
53-
</span>
54-
</div>
44+
<>
45+
<div className="flex h-svh flex-row gap-0">
46+
<ChatMenuNavbar />
47+
48+
<div className="flex w-full flex-col">
49+
<ChatHeader />
50+
<div className="m-auto mt-10 flex w-4/5 flex-grow flex-col gap-3">
51+
<span className="text-7xl font-semibold">{`Hello, ${firstName}`}</span>
52+
<span className="text-3xl font-semibold text-primaryColor">
53+
How can I help you today?
54+
</span>
55+
</div>
5556

56-
<div className="mb-5">
57-
<InputField onSubmit={handleInitialSendMessage} messageStreaming={false} />
57+
<div className="mb-5">
58+
<InputField onSubmit={handleInitialSendMessage} messageStreaming={false} />
59+
</div>
5860
</div>
5961
</div>
60-
</div>
62+
<Toast />
63+
</>
6164
);
6265
}

src/app/components/chat/ChatMenuNavbar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useAuth } from '@/contexts/AuthContext';
22
import { useState, useEffect, useRef } from 'react';
3-
import { Chats } from '@/types/chat';
3+
import { Chat } from '@prisma/client';
44
import { useRouter } from 'next/navigation';
55
import Image from 'next/image';
66
import Spinner from '../Spinner';
@@ -16,7 +16,7 @@ export default function ChatMenuNavbar() {
1616
const [isNavbarOpen, setIsNavbarOpen] = useState(!(window.innerWidth < 768));
1717
const [isEmbedModalOpen, setIsEmbedModalOpen] = useState(false);
1818
const [isModelModalOpen, setIsModelModalOpen] = useState(false);
19-
const [chatHistory, setChatHistory] = useState<Chats>({ chats: [] });
19+
const [chatHistory, setChatHistory] = useState<Chat[]>([]);
2020
const [loadingHistory, setLoadingHistory] = useState(true);
2121
const router = useRouter();
2222
const menuRef = useRef<HTMLDivElement>(null);
@@ -155,7 +155,7 @@ export default function ChatMenuNavbar() {
155155
</div>
156156
) : (
157157
<div className="no-scrollbar mt-5 flex-1 flex-col justify-start overflow-y-auto">
158-
{chatHistory.chats.map((chat, index) => (
158+
{chatHistory.map((chat, index) => (
159159
<ChatHistoryEntry key={index} chat={chat} />
160160
))}
161161
</div>

0 commit comments

Comments
 (0)