@@ -4,8 +4,9 @@ import { MarkdownRenderer } from "@/components/markdown/MarkdownRenderer";
44import { LoadingDots } from "@/components/ui/LoadingDots" ;
55import { Button } from "@/components/ui/button" ;
66import { AutoResizeTextarea } from "@/components/ui/textarea" ;
7+ import siwaIcon from "@/icons/siwa-icon.png" ;
78import { cn } from "@/lib/utils" ;
8- import { ArrowUpIcon , ThumbsUpIcon , ThumbsDownIcon } from "lucide-react" ;
9+ import { ArrowUpIcon , ThumbsDownIcon , ThumbsUpIcon } from "lucide-react" ;
910import { usePostHog } from "posthog-js/react" ;
1011import {
1112 type ChangeEvent ,
@@ -16,7 +17,6 @@ import {
1617 useState ,
1718} from "react" ;
1819import { getChatResponse , sendFeedback } from "./api" ;
19- import siwaIcon from "@/icons/siwa-icon.png" ;
2020
2121interface Message {
2222 id : string ;
@@ -142,9 +142,9 @@ export function Chat() {
142142 } ) ;
143143 }
144144 } , 100 ) ;
145-
145+
146146 return ( ) => clearTimeout ( timer ) ;
147- } , [ messages ] ) ;
147+ } , [ ] ) ;
148148
149149 const handleInputChange = ( e : ChangeEvent < HTMLTextAreaElement > ) => {
150150 setInput ( e . target . value ) ;
@@ -161,15 +161,15 @@ export function Chat() {
161161
162162 const handleFeedback = async ( messageId : string , feedback : 1 | - 1 ) => {
163163 if ( ! conversationId ) return ; // Don't send feedback if no conversation
164-
164+
165165 try {
166166 await sendFeedback ( conversationId , feedback ) ;
167167 setMessages ( ( prevMessages ) =>
168168 prevMessages . map ( ( msg ) =>
169- msg . id === messageId ? { ...msg , feedback } : msg
170- )
169+ msg . id === messageId ? { ...msg , feedback } : msg ,
170+ ) ,
171171 ) ;
172- } catch ( e ) {
172+ } catch ( _e ) {
173173 // Optionally handle error
174174 }
175175 } ;
@@ -211,19 +211,21 @@ export function Chat() {
211211 type = { message . role }
212212 />
213213 { message . role === "assistant" && ! message . isLoading && (
214- < div className = "flex gap -2 mt -2" >
214+ < div className = "mt -2 flex gap -2" >
215215 { ! message . feedback && (
216216 < >
217217 < button
218+ type = "button"
218219 aria-label = "Thumbs up"
219- className = "hover: text-green-500 transition-colors text-muted-foreground "
220+ className = "text-muted-foreground transition-colors hover: text-green-500 "
220221 onClick = { ( ) => handleFeedback ( message . id , 1 ) }
221222 >
222223 < ThumbsUpIcon className = "size-5" />
223224 </ button >
224225 < button
226+ type = "button"
225227 aria-label = "Thumbs down"
226- className = "hover: text-red-500 transition-colors text-muted-foreground "
228+ className = "text-muted-foreground transition-colors hover: text-red-500 "
227229 onClick = { ( ) => handleFeedback ( message . id , - 1 ) }
228230 >
229231 < ThumbsDownIcon className = "size-5" />
0 commit comments