Signed-off-by: Oleg Ivaniv <me@olegivaniv.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com> Co-authored-by: Jesper Bylund <mail@jesperbylund.com> Co-authored-by: OlegIvaniv <me@olegivaniv.com> Co-authored-by: Deborah <deborah@starfallprojects.co.uk> Co-authored-by: Jan Oberhauser <janober@users.noreply.github.com> Co-authored-by: Jon <jonathan.bennetts@gmail.com> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in> Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com> Co-authored-by: Giulio Andreini <andreini@netseven.it> Co-authored-by: Mason Geloso <Mason.geloso@gmail.com> Co-authored-by: Mason Geloso <hone@Masons-Mac-mini.local> Co-authored-by: Mutasem Aldmour <mutasem@n8n.io>
38 lines
950 B
Vue
38 lines
950 B
Vue
<script lang="ts" setup>
|
|
import type { PropType } from 'vue';
|
|
import Message from '@n8n/chat/components/Message.vue';
|
|
import type { ChatMessage } from '@n8n/chat/types';
|
|
import MessageTyping from '@n8n/chat/components/MessageTyping.vue';
|
|
import { useChat } from '@n8n/chat/composables';
|
|
|
|
defineProps({
|
|
messages: {
|
|
type: Array as PropType<ChatMessage[]>,
|
|
required: true,
|
|
},
|
|
});
|
|
|
|
const chatStore = useChat();
|
|
|
|
const { initialMessages, waitingForResponse } = chatStore;
|
|
</script>
|
|
<template>
|
|
<div class="chat-messages-list">
|
|
<Message
|
|
v-for="initialMessage in initialMessages"
|
|
:key="initialMessage.id"
|
|
:message="initialMessage"
|
|
/>
|
|
<Message v-for="message in messages" :key="message.id" :message="message" />
|
|
<MessageTyping v-if="waitingForResponse" />
|
|
</div>
|
|
</template>
|
|
|
|
<style lang="scss">
|
|
.chat-messages-list {
|
|
margin-top: auto;
|
|
display: block;
|
|
padding: var(--chat--messages-list--padding, var(--chat--spacing));
|
|
}
|
|
</style>
|