@@ -23,18 +23,18 @@ const MOTION_PROPS = {
2323 } ,
2424} ;
2525
26- interface ChatInputProps {
26+ interface AgentChatInputProps {
2727 chatOpen : boolean ;
2828 isAgentAvailable ?: boolean ;
2929 onSend ?: ( message : string ) => void ;
3030}
3131
32- export function ChatInput ( {
32+ export function AgentChatInput ( {
3333 chatOpen,
3434 isAgentAvailable = false ,
3535 onSend = async ( ) => { } ,
36- } : ChatInputProps ) {
37- const inputRef = useRef < HTMLInputElement > ( null ) ;
36+ } : AgentChatInputProps ) {
37+ const inputRef = useRef < HTMLTextAreaElement > ( null ) ;
3838 const [ isSending , setIsSending ] = useState ( false ) ;
3939 const [ message , setMessage ] = useState < string > ( '' ) ;
4040
@@ -71,23 +71,22 @@ export function ChatInput({
7171 onSubmit = { handleSubmit }
7272 className = "mb-3 flex grow items-end gap-2 rounded-md pl-1 text-sm"
7373 >
74- < input
74+ < textarea
7575 autoFocus
7676 ref = { inputRef }
77- type = "text"
7877 value = { message }
7978 disabled = { ! chatOpen }
8079 placeholder = "Type something..."
8180 onChange = { ( e ) => setMessage ( e . target . value ) }
82- className = "h- 8 flex-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
81+ className = "field-sizing-content max-h-16 min-h- 8 flex-1 py-2 [scrollbar-width:thin] focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
8382 />
8483 < Button
8584 size = "icon"
8685 type = "submit"
8786 disabled = { isDisabled }
8887 variant = { isDisabled ? 'secondary' : 'default' }
8988 title = { isSending ? 'Sending...' : 'Send' }
90- className = "self-start rounded-full"
89+ className = "self-end rounded-full disabled:cursor-not-allowed "
9190 >
9291 { isSending ? (
9392 < SpinnerIcon className = "animate-spin" weight = "bold" />
0 commit comments