diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 6379eb0a..3be40df7 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -92,8 +92,7 @@ const ConversationBubble = forwardRef< const [editInputBox, setEditInputBox] = useState(''); const messageRef = useRef(null); const [shouldShowToggle, setShouldShowToggle] = useState(false); - const [isLikeClicked, setIsLikeClicked] = useState(false); - const [isDislikeClicked, setIsDislikeClicked] = useState(false); + const [activeTooltip, setActiveTooltip] = useState(null); const [isSidebarOpen, setIsSidebarOpen] = useState(false); const editableQueryRef = useRef(null); @@ -550,104 +549,71 @@ const ConversationBubble = forwardRef< )} {message && (
-
-
- -
-
-
-
- -
-
- {type === 'ERROR' && ( + {type === 'ERROR' ? (
{retryBtn}
- )} - {handleFeedback && ( + ) : ( <> -
-
-
- { - if (feedback === undefined || feedback === null) { - handleFeedback?.('LIKE'); - setIsLikeClicked(true); - setIsDislikeClicked(false); - } else if (feedback === 'LIKE') { - handleFeedback?.(null); - setIsLikeClicked(false); - setIsDislikeClicked(false); - } - }} - onMouseEnter={() => setIsLikeHovered(true)} - onMouseLeave={() => setIsLikeHovered(false)} - > -
-
+
+
+
+ +
+ {handleFeedback && ( + <> +
+
+
+ { + if (feedback === 'LIKE') { + handleFeedback?.(null); + } else { + handleFeedback?.('LIKE'); + } + }} + onMouseEnter={() => setIsLikeHovered(true)} + onMouseLeave={() => setIsLikeHovered(false)} + > +
+
+
-
-
-
- { - if (feedback === undefined || feedback === null) { - handleFeedback?.('DISLIKE'); - setIsDislikeClicked(true); - setIsLikeClicked(false); - } else if (feedback === 'DISLIKE') { - handleFeedback?.(null); - setIsLikeClicked(false); - setIsDislikeClicked(false); - } - }} - onMouseEnter={() => setIsDislikeHovered(true)} - onMouseLeave={() => setIsDislikeHovered(false)} - > +
+
+
+ { + if (feedback === 'DISLIKE') { + handleFeedback?.(null); + } else { + handleFeedback?.('DISLIKE'); + } + }} + onMouseEnter={() => setIsDislikeHovered(true)} + onMouseLeave={() => setIsDislikeHovered(false)} + > +
+
-
-
+ + )} )}