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:
25
app/components/Chat/ChannelList.vue
Normal file
25
app/components/Chat/ChannelList.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
// The seeded channels of the community. There is no create button: members
|
||||
// join and leave the channels the host has.
|
||||
const { t } = useI18n()
|
||||
const chat = useChat()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<nav class="chat-sidebar" :aria-label="t('chat.channels')">
|
||||
<h2 class="chat-sidebar-title">{{ t('chat.channels') }}</h2>
|
||||
<ul class="chat-channels">
|
||||
<li v-for="c in chat.channels.value" :key="c.id">
|
||||
<button
|
||||
class="chat-channel"
|
||||
type="button"
|
||||
:data-channel-slug="c.slug"
|
||||
:aria-current="chat.activeId.value === c.conversation_id ? 'true' : undefined"
|
||||
@click="chat.open(c)"
|
||||
>
|
||||
# {{ c.name }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</template>
|
||||
Reference in New Issue
Block a user