Files
gochat/frontend/app/javascript/dashboard/components-next/message/bubbles/Activity.vue
T
Rogee b78f963472 chore: 提交剩余开发改动
包含商务通消息映射、会话时间与未读状态、前端消息展示、数据库修复迁移、测试覆盖备份及 Captain 设计文档。
2026-08-06 10:10:25 +08:00

33 lines
902 B
Vue

<script setup>
import { computed } from 'vue';
import { zhCN } from 'date-fns/locale';
import { useI18n } from 'vue-i18n';
import { messageTimestamp } from 'shared/helpers/timeHelper';
import BaseBubble from './Base.vue';
import { useMessageContext } from '../provider.js';
const { content, createdAt } = useMessageContext();
const { locale } = useI18n();
const readableTime = computed(() => {
if (locale.value === 'zh_CN') {
return messageTimestamp(createdAt.value, 'M月d日 aaa h:mm', {
locale: zhCN,
fallbackFormat: 'yyyy年M月d日 aaa h:mm',
});
}
return messageTimestamp(createdAt.value, 'LLL d, h:mm a');
});
</script>
<template>
<BaseBubble
v-tooltip.top="readableTime"
class="px-3 py-1 !rounded-xl flex min-w-0 items-center gap-2"
data-bubble-name="activity"
>
<span v-dompurify-html="content" :title="content" />
</BaseBubble>
</template>