diff --git a/frontend/src/app/api.tsx b/frontend/src/app/api.tsx
index 7f1210f..651d3fe 100644
--- a/frontend/src/app/api.tsx
+++ b/frontend/src/app/api.tsx
@@ -1,9 +1,13 @@
import { API_URL } from "../domain/config";
export const api = {
- async createConversation() {
+ async createConversation(userId: string) {
const response = await fetch(`${API_URL}/conversation/create`, {
method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({ user_id: userId }),
});
return response.json();
},
@@ -14,7 +18,7 @@ export const api = {
headers: {
'Content-Type': 'application/json',
},
- body: JSON.stringify({ conversation_id: conversationId, message }),
+ body: JSON.stringify({ conversation_id: conversationId, message:message }),
});
return response.json();
},
@@ -25,4 +29,11 @@ export const api = {
});
return response.json();
},
+
+ async getUserConversations(userId: string) {
+ const response = await fetch(`${API_URL}/conversation/user/${userId}`, {
+ method: 'GET',
+ });
+ return response.json();
+ },
};
\ No newline at end of file
diff --git a/frontend/src/app/components/MessageList.tsx b/frontend/src/app/components/MessageList.tsx
index 46a4faa..a53848b 100644
--- a/frontend/src/app/components/MessageList.tsx
+++ b/frontend/src/app/components/MessageList.tsx
@@ -12,7 +12,7 @@ type MessageListProps = {
export default function MessageList({ messages }: MessageListProps) {
return (
-
+
{messages.map((msg) => (
-
+
{msg.text}
diff --git a/frontend/src/app/components/Sidebar.tsx b/frontend/src/app/components/Sidebar.tsx
index 5b959dc..1e7eefa 100644
--- a/frontend/src/app/components/Sidebar.tsx
+++ b/frontend/src/app/components/Sidebar.tsx
@@ -1,5 +1,6 @@
import { useRef } from 'react';
import Link from 'next/link';
+import { motion, AnimatePresence } from 'framer-motion';
type Conversation = {
id: number;
@@ -20,41 +21,98 @@ export default function Sidebar({ conversations, currentConversationId, onConver
return (