Skip to content

Commit f6a9920

Browse files
author
pengyu
committed
adjust the chatbox
1 parent 53e89a1 commit f6a9920

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

frontend/src/components/root/prompt-form.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,14 @@ export const PromptForm = forwardRef<PromptFormRef, PromptFormProps>(
283283
</Select>
284284
</div>
285285

286-
<div className="flex items-center gap-4">
286+
<div className="flex items-center gap-2">
287287
{/* Magic enhance tooltip */}
288288
<TooltipProvider>
289289
<Tooltip>
290290
<TooltipTrigger asChild>
291291
<div
292292
onClick={
293-
!isLoading && !isRegenerating
293+
!isLoading && !isRegenerating && message.trim()
294294
? handleMagicEnhance
295295
: undefined
296296
}
@@ -300,10 +300,10 @@ export const PromptForm = forwardRef<PromptFormRef, PromptFormProps>(
300300
'active:outline-none active:ring-0 active:border-0',
301301
isEnhanced
302302
? isDarkMode
303-
? 'text-blue-700 hover:text-blue-700'
303+
? 'text-primary-100 hover:text-primary-100'
304304
: 'text-yellow-300 hover:text-yellow-300'
305305
: 'text-gray-500 hover:text-gray-500',
306-
(isLoading || isRegenerating) &&
306+
(isLoading || isRegenerating || !message.trim()) &&
307307
'opacity-50 cursor-not-allowed'
308308
)}
309309
style={{
@@ -321,9 +321,9 @@ export const PromptForm = forwardRef<PromptFormRef, PromptFormProps>(
321321
onMouseUp={(e) => e.preventDefault()}
322322
>
323323
<Sparkles
324-
size={36}
324+
size={24}
325325
className={cn(
326-
'w-6 h-6',
326+
'w-5 h-5',
327327
isRegenerating && 'animate-spin'
328328
)}
329329
/>
@@ -343,11 +343,11 @@ export const PromptForm = forwardRef<PromptFormRef, PromptFormProps>(
343343
<Button
344344
className={cn(
345345
'bg-gradient-to-r from-primary-500 to-primary-600 hover:from-primary-600 hover:to-primary-700 text-white shadow-md hover:shadow-lg transition-all px-5 py-3 h-10 rounded-full',
346-
(isLoading || isRegenerating) &&
346+
(isLoading || isRegenerating || !message.trim()) &&
347347
'opacity-80 cursor-not-allowed'
348348
)}
349349
onClick={handleSubmit}
350-
disabled={isLoading || isRegenerating}
350+
disabled={isLoading || isRegenerating || !message.trim()}
351351
>
352352
{isLoading ? (
353353
<>

0 commit comments

Comments
 (0)