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
+5 -1
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"
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>
{showPromptList && filteredPrompts.length > 0 && (