mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 11:08:04 +00:00 
			
		
		
		
	 16fe912fbd
			
		
	
	16fe912fbd
	
	
	
		
			
			Co-authored-by: Nithin David Thomas <webofnithin@gmail.com> Co-authored-by: Sojan Jose <sojan@pepalo.com>
		
			
				
	
	
		
			66 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Vue
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			66 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Vue
		
	
	
		
			Executable File
		
	
	
	
	
| <template>
 | |
|   <div class="input-wrap">
 | |
|     <div>
 | |
|       <ChatInputArea v-model="userInput" :placeholder="placeholder" />
 | |
|     </div>
 | |
|     <div class="message-button-wrap">
 | |
|       <ChatSendButton
 | |
|         :on-click="handleButtonClick"
 | |
|         :disabled="!userInput.length"
 | |
|       />
 | |
|     </div>
 | |
|   </div>
 | |
| </template>
 | |
| 
 | |
| <script>
 | |
| import ChatSendButton from 'widget/components/ChatSendButton.vue';
 | |
| import ChatInputArea from 'widget/components/ChatInputArea.vue';
 | |
| 
 | |
| export default {
 | |
|   name: 'ChatInputWrap',
 | |
|   components: {
 | |
|     ChatSendButton,
 | |
|     ChatInputArea,
 | |
|   },
 | |
| 
 | |
|   props: {
 | |
|     placeholder: {
 | |
|       type: String,
 | |
|       default: 'Type your message',
 | |
|     },
 | |
|     onSendMessage: {
 | |
|       type: Function,
 | |
|       default: () => {},
 | |
|     },
 | |
|   },
 | |
| 
 | |
|   data() {
 | |
|     return {
 | |
|       userInput: '',
 | |
|     };
 | |
|   },
 | |
|   methods: {
 | |
|     handleButtonClick() {
 | |
|       if (this.userInput) {
 | |
|         this.onSendMessage(this.userInput);
 | |
|       }
 | |
|       this.userInput = '';
 | |
|     },
 | |
|   },
 | |
| };
 | |
| </script>
 | |
| 
 | |
| <style scoped lang="scss">
 | |
| @import '~widget/assets/scss/variables.scss';
 | |
| 
 | |
| .input-wrap {
 | |
|   .message-button-wrap {
 | |
|     align-items: center;
 | |
|     display: flex;
 | |
|     flex-direction: row;
 | |
|     justify-content: flex-end;
 | |
|     margin-top: $space-small;
 | |
|   }
 | |
| }
 | |
| </style>
 |