diff --git a/web-app/src/components/ui/Button/ActionButton.css b/web-app/src/components/ui/button/action-button.css
similarity index 100%
rename from web-app/src/components/ui/Button/ActionButton.css
rename to web-app/src/components/ui/button/action-button.css
diff --git a/web-app/src/components/ui/Button/ActionButton.jsx b/web-app/src/components/ui/button/action-button.jsx
similarity index 86%
rename from web-app/src/components/ui/Button/ActionButton.jsx
rename to web-app/src/components/ui/button/action-button.jsx
index a14b1fe..52573a5 100644
--- a/web-app/src/components/ui/Button/ActionButton.jsx
+++ b/web-app/src/components/ui/button/action-button.jsx
@@ -1,15 +1,15 @@
-import './ActionButton.css';
+import "./action-button.css";
export default function ActionButton({
onClick,
children,
- type = 'add', // 'add' or 'delete'
+ type = "add", // 'add' or 'delete'
...props
}) {
// Define color and icon based on type
const config = {
add: {
- color: '#0F2862',
+ color: "#0F2862",
svg: (
),
},
@@ -47,10 +47,10 @@ export default function ActionButton({
);
diff --git a/web-app/src/components/ui/chat/chat-header.jsx b/web-app/src/components/ui/chat/chat-header.jsx
index 9b30b6c..a7d403d 100644
--- a/web-app/src/components/ui/chat/chat-header.jsx
+++ b/web-app/src/components/ui/chat/chat-header.jsx
@@ -1,39 +1,9 @@
import React from "react";
-import ActionButton from "src/components/ui/Button/ActionButton.jsx";
-
-export default function ChatHeader({ title = "AI Assistant" }) {
- // Delete chat log (frontend + backend)
- const handleDeleteChat = async () => {
- if (!window.confirm("Delete all messages?")) return;
- await fetch(`/api/chat/${conversationId}`, { method: "DELETE" });
- setMessages([]);
- };
-
- // Restart chat (new conversation)
- const handleNewChat = async () => {
- const res = await fetch("/api/chat/new", { method: "POST" });
- const data = await res.json();
- if (data.success) {
- setConversationId(data.conversationId);
- setMessages([]);
- }
- };
+export default function ChatHeader({ title = "Title of Chat" }) {
return (
-
-
-
- AI
-
-
-
{title}
-
- Ask anything — AI is listening
-
-
-
-
-
+
);
}
diff --git a/web-app/src/components/ui/chat/chat-window.jsx b/web-app/src/components/ui/chat/chat-window.jsx
index 7e8af82..9966973 100644
--- a/web-app/src/components/ui/chat/chat-window.jsx
+++ b/web-app/src/components/ui/chat/chat-window.jsx
@@ -1,11 +1,10 @@
import React, { useRef, useEffect } from "react";
-
function MessageBubble({ message }) {
const isUser = message.role === "user";
return (
{
- chatRef.current?.scrollTo({
- top: chatRef.current.scrollHeight,
- behavior: "smooth",
- });
- }, [messages]);
-
return (
-
+
{messages.map((m, i) => (
))}
-
+
);
}
diff --git a/web-app/src/components/ui/chat/message-input.jsx b/web-app/src/components/ui/chat/message-input.jsx
index 2ca272e..74efe54 100644
--- a/web-app/src/components/ui/chat/message-input.jsx
+++ b/web-app/src/components/ui/chat/message-input.jsx
@@ -11,18 +11,15 @@ export default function MessageInput({ onSend }) {
}
return (
-