diff --git a/apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx b/apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx index 6f57961bd79..0673aa4fa8c 100644 --- a/apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx +++ b/apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx @@ -339,7 +339,6 @@ export function ChatPageContent(props: { {messages.length > 0 && ( {}} client={storybookThirdwebClient} diff --git a/apps/dashboard/src/app/nebula-app/(app)/components/Chats.tsx b/apps/dashboard/src/app/nebula-app/(app)/components/Chats.tsx index 76ac13d49f9..484c0e0c0d7 100644 --- a/apps/dashboard/src/app/nebula-app/(app)/components/Chats.tsx +++ b/apps/dashboard/src/app/nebula-app/(app)/components/Chats.tsx @@ -1,11 +1,9 @@ import { ScrollShadow } from "@/components/ui/ScrollShadow/ScrollShadow"; import { cn } from "@/lib/utils"; import { MarkdownRenderer } from "components/contract-components/published-contract/markdown-renderer"; -import { AlertCircleIcon, ThumbsDownIcon, ThumbsUpIcon } from "lucide-react"; -import { useEffect, useRef, useState } from "react"; +import { AlertCircleIcon } from "lucide-react"; +import { useEffect, useRef } from "react"; import type { ThirdwebClient } from "thirdweb"; -import { Button } from "../../../../@/components/ui/button"; -import { useTrack } from "../../../../hooks/analytics/useTrack"; import type { NebulaSwapData } from "../api/chat"; import type { NebulaUserMessage, NebulaUserMessageContent } from "../api/types"; import { NebulaIcon } from "../icons/NebulaIcon"; @@ -74,7 +72,6 @@ export function Chats(props: { enableAutoScroll: boolean; useSmallText?: boolean; sendMessage: (message: NebulaUserMessage) => void; - teamId: string | undefined; }) { const { messages, setEnableAutoScroll, enableAutoScroll } = props; const scrollAnchorRef = useRef(null); @@ -156,7 +153,6 @@ export function Chats(props: { nextMessage={props.messages[index + 1]} authToken={props.authToken} sessionId={props.sessionId} - teamId={props.teamId} /> ); @@ -176,7 +172,6 @@ function RenderMessage(props: { sendMessage: (message: NebulaUserMessage) => void; nextMessage: ChatMessage | undefined; authToken: string; - teamId: string | undefined; sessionId: string | undefined; }) { const { message } = props; @@ -229,41 +224,6 @@ function RenderMessage(props: { ); } - // Feedback for assistant messages - if (props.message.type === "assistant") { - return ( -
-
- {/* Left Icon */} -
-
- -
-
- {/* Right Message */} -
- - - - -
-
-
- ); - } - return (
{/* Left Icon */} @@ -462,81 +422,3 @@ function StyledMarkdownRenderer(props: { /> ); } - -function FeedbackButtons({ - sessionId, - authToken, - teamId, -}: { - sessionId: string | undefined; - authToken: string; - teamId: string | undefined; -}) { - const [, setFeedback] = useState<1 | -1 | null>(null); - const [loading, setLoading] = useState(false); - const [thankYou, setThankYou] = useState(false); - const trackEvent = useTrack(); - - async function sendFeedback(rating: 1 | -1) { - setLoading(true); - try { - trackEvent({ - category: "siwa", - action: "submit-feedback", - rating: rating === 1 ? "good" : "bad", - sessionId, - teamId, - }); - const apiUrl = process.env.NEXT_PUBLIC_SIWA_URL; - await fetch(`${apiUrl}/v1/chat/feedback`, { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${authToken}`, - ...(teamId ? { "x-team-id": teamId } : {}), - }, - body: JSON.stringify({ - conversationId: sessionId, - feedbackRating: rating, - }), - }); - setFeedback(rating); - setThankYou(true); - } catch { - // TODO handle error - } finally { - setLoading(false); - } - } - - if (thankYou) { - return ( -
- Thank you for your feedback! -
- ); - } - - return ( -
- - -
- ); -} diff --git a/apps/dashboard/src/app/nebula-app/(app)/components/CustomChat/CustomChatContent.tsx b/apps/dashboard/src/app/nebula-app/(app)/components/CustomChat/CustomChatContent.tsx index 6eb1b3767a0..2547afc0db0 100644 --- a/apps/dashboard/src/app/nebula-app/(app)/components/CustomChat/CustomChatContent.tsx +++ b/apps/dashboard/src/app/nebula-app/(app)/components/CustomChat/CustomChatContent.tsx @@ -158,7 +158,6 @@ function CustomChatContentLoggedIn(props: { /> ) : ( ) : (