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}
This commit is contained in:
16
app/components/Chat/MessageList.vue
Normal file
16
app/components/Chat/MessageList.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user