fix: loading card

feat/course
Arik Chakma 2 months ago
parent 0e44c85377
commit 2cd8b52fad
  1. 6
      src/components/CourseAI/CourseAIPopover.tsx

@ -69,6 +69,7 @@ export function CourseAIPopover(props: CourseAIPopoverProps) {
setMessage('');
});
scrollToBottom();
completeCourseAIChat(newMessages);
};
@ -181,6 +182,10 @@ export function CourseAIPopover(props: CourseAIPopoverProps) {
);
})}
{isLoading && !streamedMessage && (
<AIChatCard role="assistant" content="Thinking..." />
)}
{streamedMessage && (
<AIChatCard role="assistant" content={streamedMessage} />
)}
@ -198,6 +203,7 @@ export function CourseAIPopover(props: CourseAIPopoverProps) {
placeholder="Ask AI anything about the course..."
value={message}
onChange={(e) => setMessage(e.target.value)}
autoFocus={true}
/>
<button
type="submit"

Loading…
Cancel
Save