File tree 1 file changed +19
-2
lines changed
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,10 @@ function InputPanel({
94
94
}
95
95
96
96
function SendButton ( ) {
97
- if ( status === 'idle' || status === 'recording' || status === 'connecting' ) {
97
+ if (
98
+ ( status === 'idle' || status === 'recording' || status === 'connecting' ) &&
99
+ userInput . length > 0
100
+ ) {
98
101
return (
99
102
< button
100
103
type = "button"
@@ -105,6 +108,20 @@ function InputPanel({
105
108
< div > { i18n . t ( 'common.send' ) } </ div >
106
109
</ button >
107
110
) ;
111
+ } else if (
112
+ ( status === 'idle' || status === 'recording' || status === 'connecting' ) &&
113
+ userInput . length == 0
114
+ ) {
115
+ return (
116
+ < button
117
+ type = "button"
118
+ className = "flex flex-row items-center space-x-2 rounded-lg px-4 py-2 font-medium text-white bg-gradient-to-tr from-indigo-500 to-purple-500 transition-colors duration-300 cursor-not-allowed"
119
+ onClick = { handleSend }
120
+ >
121
+ < IconSend className = "h-5 w-5" />
122
+ < div > { i18n . t ( 'common.send' ) } </ div >
123
+ </ button >
124
+ ) ;
108
125
} else {
109
126
return (
110
127
< button
@@ -133,7 +150,7 @@ function InputPanel({
133
150
/>
134
151
< div className = "flex flex-row space-x-2 justify-end" >
135
152
{ /*<div className="self-end text-gray-700">{i18n.t('common.status')}: {status}</div>*/ }
136
- < RecordButton />
153
+ { ! disableMicrophone && < RecordButton /> }
137
154
< SendButton />
138
155
</ div >
139
156
</ div >
You can’t perform that action at this time.
0 commit comments