@@ -14,7 +14,16 @@ import { ModelInfo, ToolInfo } from '@/api/model'
1414import { useMutation } from '@tanstack/react-query'
1515import { useDrop } from 'ahooks'
1616import { produce } from 'immer'
17- import { ArrowUp , Loader2 , PlusIcon , Square , XIcon , RectangleVertical , ChevronDown , Hash } from 'lucide-react'
17+ import {
18+ ArrowUp ,
19+ Loader2 ,
20+ PlusIcon ,
21+ Square ,
22+ XIcon ,
23+ RectangleVertical ,
24+ ChevronDown ,
25+ Hash ,
26+ } from 'lucide-react'
1827import { AnimatePresence , motion } from 'motion/react'
1928import Textarea , { TextAreaRef } from 'rc-textarea'
2029import { useCallback , useEffect , useRef , useState } from 'react'
@@ -407,7 +416,7 @@ const ChatTextarea: React.FC<ChatTextareaProps> = ({
407416 />
408417
409418 < div className = "flex items-center justify-between gap-2 w-full" >
410- < div className = "flex items-center gap-2 max-w-[calc(100%-50px)]" >
419+ < div className = "flex items-center gap-2 max-w-[calc(100%-50px)] flex-wrap " >
411420 < input
412421 ref = { imageInputRef }
413422 type = "file"
@@ -418,7 +427,7 @@ const ChatTextarea: React.FC<ChatTextareaProps> = ({
418427 />
419428 < Button
420429 variant = "outline"
421- size = "icon "
430+ size = "sm "
422431 onClick = { ( ) => imageInputRef . current ?. click ( ) }
423432 >
424433 < PlusIcon className = "size-4" />
@@ -431,7 +440,8 @@ const ChatTextarea: React.FC<ChatTextareaProps> = ({
431440 < DropdownMenuTrigger asChild >
432441 < Button
433442 variant = "outline"
434- className = "h-9 px-3 flex items-center gap-2"
443+ className = "flex items-center gap-1"
444+ size = { 'sm' }
435445 >
436446 < RectangleVertical className = "size-4" />
437447 < span className = "text-sm" > { selectedAspectRatio } </ span >
@@ -458,8 +468,9 @@ const ChatTextarea: React.FC<ChatTextareaProps> = ({
458468 < div className = "relative" ref = { quantitySliderRef } >
459469 < Button
460470 variant = "outline"
461- className = "h-9 px-3 flex items-center gap-2 "
471+ className = "flex items-center gap-1 "
462472 onClick = { ( ) => setShowQuantitySlider ( ! showQuantitySlider ) }
473+ size = { 'sm' }
463474 >
464475 < Hash className = "size-4" />
465476 < span className = "text-sm" > { quantity } </ span >
@@ -470,16 +481,20 @@ const ChatTextarea: React.FC<ChatTextareaProps> = ({
470481 < AnimatePresence >
471482 { showQuantitySlider && (
472483 < motion . div
473- className = "absolute bottom-full mb-2 left-1/2 -translate-x-1/2 bg-background border border-border rounded-lg p-4 shadow-lg min-w-48"
484+ className = "absolute bottom-full mb-2 left-0 bg-background border border-border rounded-lg p-4 shadow-lg min-w-48"
474485 initial = { { opacity : 0 , y : 10 , scale : 0.95 } }
475486 animate = { { opacity : 1 , y : 0 , scale : 1 } }
476487 exit = { { opacity : 0 , y : 10 , scale : 0.95 } }
477488 transition = { { duration : 0.15 , ease : 'easeOut' } }
478489 >
479490 < div className = "flex flex-col gap-3" >
480491 < div className = "flex items-center justify-between" >
481- < span className = "text-sm font-medium" > { t ( 'chat:textarea.quantity' ) } </ span >
482- < span className = "text-sm text-muted-foreground" > { quantity } </ span >
492+ < span className = "text-sm font-medium" >
493+ { t ( 'chat:textarea.quantity' , 'Image Quantity' ) }
494+ </ span >
495+ < span className = "text-sm text-muted-foreground" >
496+ { quantity }
497+ </ span >
483498 </ div >
484499 < div className = "flex items-center gap-3" >
485500 < span className = "text-xs text-muted-foreground" > 1</ span >
@@ -496,7 +511,9 @@ const ChatTextarea: React.FC<ChatTextareaProps> = ({
496511 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:rounded-full
497512 [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:cursor-pointer [&::-moz-range-thumb]:border-0"
498513 />
499- < span className = "text-xs text-muted-foreground" > { MAX_QUANTITY } </ span >
514+ < span className = "text-xs text-muted-foreground" >
515+ { MAX_QUANTITY }
516+ </ span >
500517 </ div >
501518 </ div >
502519 { /* Arrow pointing down */ }
0 commit comments