diff --git a/components/Feedback.tsx b/components/Feedback.tsx index feda3b8..6475769 100644 --- a/components/Feedback.tsx +++ b/components/Feedback.tsx @@ -30,24 +30,25 @@ import { ChatBubbleIcon } from "@radix-ui/react-icons"; import { Textarea } from "./ui/textarea"; export const Feedback: FC<{ - isVisible: boolean; + isLoading: boolean; recordFeedback: (feedback: "positive" | "negative") => void; sessionId: string; -}> = ({ isVisible, recordFeedback, sessionId }) => { +}> = ({ isLoading: isLoading, recordFeedback, sessionId }) => { const [isFeedbackRecorded, setIsFeedbackRecorded] = useState(false); + const isComponentVisible = isLoading ? "hidden" : "opacity-100"; // hide the component when the answer is loading. TODO: fix scroll to bottom when it reappears. const feedbackButtonVisibility = [ - isVisible ? "opacity-100" : "hidden", isFeedbackRecorded && "hidden duration-300 ease-in", ]; return (