- {/* Added a large mb so that the last card have a bottom space to breath */}
-
-
+
+
+
- {/*
- Right sidebar components here
-
*/}
);
diff --git a/services/dashboard/src/pages/Investigation/components/ChatWidget.tsx b/services/dashboard/src/pages/Investigation/components/ChatWidget.tsx
new file mode 100644
index 0000000..7025e97
--- /dev/null
+++ b/services/dashboard/src/pages/Investigation/components/ChatWidget.tsx
@@ -0,0 +1,245 @@
+import { Button } from "@/components/base/buttons/button";
+import Typography from "@/components/common/Typography";
+import { Tooltip, TooltipTrigger } from "@/components/base/tooltip/tooltip";
+import { Edit01, ClockRewind, XClose, ArrowCircleUp } from "@untitledui/icons";
+import { useState, useRef, useEffect } from "react";
+import logoCat from "@/assets/logo-cat.png";
+import { cx } from "@/utils/cx";
+import { motion, AnimatePresence } from "motion/react";
+
+interface Message {
+ id: string;
+ role: "assistant" | "user";
+ content: string;
+ timestamp: string;
+}
+
+function getFormattedTimestamp() {
+ return new Intl.DateTimeFormat("en-US", {
+ day: "numeric",
+ month: "short",
+ year: "numeric",
+ hour: "numeric",
+ minute: "numeric",
+ hour12: true,
+ }).format(new Date());
+}
+
+const INITIAL_MESSAGES: Message[] = [
+ {
+ id: "1",
+ role: "assistant",
+ content: "How can I help you today?",
+ timestamp: getFormattedTimestamp(),
+ },
+];
+
+export function ChatWidget() {
+ const [messages, setMessages] = useState
(INITIAL_MESSAGES);
+ const [inputValue, setInputValue] = useState("");
+ const [isCollapsed, setIsCollapsed] = useState(false);
+ const messagesEndRef = useRef(null);
+ const textareaRef = useRef(null);
+
+ useEffect(() => {
+ if (!isCollapsed) {
+ messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
+ }
+ }, [messages, isCollapsed]);
+
+ function handleSend() {
+ const trimmed = inputValue.trim();
+ if (!trimmed) return;
+
+ setMessages((prev) => [
+ ...prev,
+ {
+ id: Date.now().toString(),
+ role: "user",
+ content: trimmed,
+ timestamp: getFormattedTimestamp(),
+ },
+ ]);
+ setInputValue("");
+ if (textareaRef.current) {
+ textareaRef.current.style.height = "auto";
+ }
+ }
+
+ function handleKeyDown(e: React.KeyboardEvent) {
+ if (e.key === "Enter" && !e.shiftKey) {
+ e.preventDefault();
+ handleSend();
+ }
+ }
+
+ function handleTextareaChange(e: React.ChangeEvent) {
+ setInputValue(e.target.value);
+ // Auto-resize
+ const el = e.target;
+ el.style.height = "auto";
+ el.style.height = `${el.scrollHeight}px`;
+ }
+
+ function handleNewChat() {
+ setMessages(INITIAL_MESSAGES);
+ setInputValue("");
+ }
+
+ return (
+
+
isCollapsed && setIsCollapsed(false)}
+ >
+ {/* Collapsed Logo - only visible when collapsed */}
+
+ {isCollapsed && (
+
+
+
+ )}
+
+
+ {/* Expanded Content - Fades out when collapsed */}
+
+ {/* Header */}
+
+
+
+
+
+ }
+ />
+
+
+
+
+
+

+
+ CHAT
+
+
+
+
+
+
+
+
+
+
+ {/* Messages */}
+
+ {messages.map((msg) => (
+
+ ))}
+
+
+
+ {/* Input area */}
+
+
+
+
+
+
+
+
+
+ );
+}
+
+function ChatMessage({ message }: { message: Message }) {
+ if (message.role === "assistant") {
+ return (
+
+
+
+ {message.content}
+
+
+
+ );
+ }
+
+ return (
+
+
+
+ {message.content}
+
+
+
+ );
+}
diff --git a/services/dashboard/src/pages/Investigation/components/InvestigationDetailsVerdict.tsx b/services/dashboard/src/pages/Investigation/components/InvestigationDetailsVerdict.tsx
index 940f1ae..ccd64ef 100644
--- a/services/dashboard/src/pages/Investigation/components/InvestigationDetailsVerdict.tsx
+++ b/services/dashboard/src/pages/Investigation/components/InvestigationDetailsVerdict.tsx
@@ -23,20 +23,20 @@ const CONFIDENCE_LEVEL_MAP = {
},
};
-export function InvestigationDetailsVerdict() {
+export function InvestigationDetailsVerdict({ className }: { className?: string }) {
const { id } = useParams();
const { data: investigation } = useInvestigation(id || "");
-
+
const { hypothesis, rootCause, recommendedFix, confidenceLevel } =
investigation;
-
+
return (
-
-
+
+
ASTER'S VERDICT
-
+
diff --git a/services/dashboard/src/pages/Investigation/components/index.ts b/services/dashboard/src/pages/Investigation/components/index.ts
index 94e44d5..2890bbe 100644
--- a/services/dashboard/src/pages/Investigation/components/index.ts
+++ b/services/dashboard/src/pages/Investigation/components/index.ts
@@ -1,3 +1,4 @@
export { InvestigationDetailsHeader } from "./InvestigationDetailsHeader";
export { InvestigationDetailsVerdict } from "./InvestigationDetailsVerdict";
export { IntegrationDetailsEvidenceChain } from "./IntegrationDetailsEvidenceChain";
+export { ChatWidget } from "./ChatWidget";