Adds a loading spinner that replaces send icon while result is generated (#329)

This commit is contained in:
Jason Banich 2023-04-01 22:02:15 -07:00 committed by GitHub
parent 56d3b2fba2
commit 23ad285a4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -286,7 +286,11 @@ export const ChatInput: FC<Props> = ({
className="absolute right-2 top-2 rounded-sm p-1 text-neutral-800 opacity-60 hover:bg-neutral-200 hover:text-neutral-900 dark:bg-opacity-50 dark:text-neutral-100 dark:hover:text-neutral-200" className="absolute right-2 top-2 rounded-sm p-1 text-neutral-800 opacity-60 hover:bg-neutral-200 hover:text-neutral-900 dark:bg-opacity-50 dark:text-neutral-100 dark:hover:text-neutral-200"
onClick={handleSend} onClick={handleSend}
> >
<IconSend size={18} /> {messageIsStreaming ? (
<div className="h-4 w-4 animate-spin rounded-full border-t-2 border-neutral-800 opacity-60 dark:border-neutral-100"></div>
) : (
<IconSend size={18} />
)}
</button> </button>
{showPromptList && filteredPrompts.length > 0 && ( {showPromptList && filteredPrompts.length > 0 && (