Code clean-up and some fit and finish

- Add a lot more suggestions cards, improve mobile rendering of suggestion cards, improve alignment of chat input, shift message when starts recording voice, remove dead code
This commit is contained in:
sabaimran
2024-07-28 15:19:36 +05:30
parent 1a1d9c7257
commit 551630f0f1
6 changed files with 324 additions and 72 deletions

View File

@@ -258,7 +258,7 @@ export default function ChatInputArea(props: ChatInputProps) {
useEffect(() => {
if (!chatInputRef.current) return;
chatInputRef.current.style.height = 'auto';
chatInputRef.current.style.height = Math.max(chatInputRef.current.scrollHeight-24, 64) + 'px';
chatInputRef.current.style.height = Math.max(chatInputRef.current.scrollHeight - 24, 64) + 'px';
}, [message]);
return (
@@ -398,7 +398,9 @@ export default function ChatInputArea(props: ChatInputProps) {
<Button
variant={'ghost'}
className="!bg-none p-1 h-auto text-3xl rounded-full text-gray-300 hover:text-gray-500"
onClick={() => setRecording(!recording)}
onClick={() => {
setRecording(!recording);
}}
disabled={props.sendDisabled}
>
<Stop weight='fill' className={`${props.isMobileWidth ? 'w-6 h-6' : 'w-8 h-8'}`} />
@@ -420,7 +422,10 @@ export default function ChatInputArea(props: ChatInputProps) {
<Button
variant={'ghost'}
className="!bg-none p-1 h-auto text-3xl rounded-full text-gray-300 hover:text-gray-500"
onClick={() => setRecording(!recording)}
onClick={() => {
setMessage("Listening...");
setRecording(!recording);
}}
disabled={props.sendDisabled}
>
<Microphone weight='fill' className={`${props.isMobileWidth ? 'w-6 h-6' : 'w-8 h-8'}`} />