- realtime.ts: the page's one Centrifuge client, setRealtimeAuth, onUserEvent for user:{me} events the chat does not handle
- chatEvents, chatFormat, chatText, chatUnread, format, media, tabs ported; copy passed in localized
- useChat over useState: channels with join and leave, DMs, member list, unread and mention counts, read marks, typing, presence, polling fallback
- ChatPanel, ChatHeader, ChatMessage, ChatDmList, ChatMemberPicker, ChatMentionPopup, ChatAvatar, ChatIcon, ChatNotices
- EN and PL strings
15 lines
539 B
Vue
15 lines
539 B
Vue
<script setup lang="ts">
|
|
// The chat's short notices (useChatNotice), announced politely.
|
|
const { t } = useI18n()
|
|
const notice = useChatNotice()
|
|
</script>
|
|
|
|
<template>
|
|
<div class="chat-notices" role="status" aria-live="polite">
|
|
<p v-if="notice.current.value" class="chat-notice">
|
|
{{ t(`chat.${notice.current.value.key}`, notice.current.value.params ?? {}) }}
|
|
<button class="chat-icon-btn" type="button" :aria-label="t('chat.close')" @click="notice.clear()"><ChatIcon name="close" /></button>
|
|
</p>
|
|
</div>
|
|
</template>
|