Files
vue-chat-layer/app/components/Chat/MessageList.vue
Jakub Zych fa6f9950a6 feat: chat layer tracer: bootstrap, channel list, messages, composer
- createChatClient: bearer auth, one refresh-and-retry on 401, 422 field errors
- useChat over useState: host bootstrap, open a channel, send
- ChatPage, ChatChannelList, ChatMessageList, ChatComposer
- runtime config chat.apiBase, public.chat.{apiBase,channelsApiBase,botsApiBase,hostApiBase}
2026-10-31 13:40:39 +01:00

17 lines
596 B
Vue

<script setup lang="ts">
// The messages of one conversation, oldest first, as plain text.
const props = defineProps<{ conversationId: number }>()
const { t } = useI18n()
const chat = useChat()
const list = computed(() => chat.messages.value[props.conversationId] ?? [])
</script>
<template>
<div class="chat-list" role="log" :aria-label="t('chat.messages')">
<article v-for="m in list" :key="m.id" class="chat-msg" :data-message-id="m.id">
<span class="chat-msg-name">{{ m.sender_name }}</span>
<p class="chat-msg-body">{{ m.content }}</p>
</article>
</div>
</template>