跳转到内容
搜索文档

RtkMessageView

最后更新 查看 MarkdownAgent 设置

属性

属性 类型 必填 默认值 描述
actions MessageAction[] - 菜单中要显示的操作列表
authorName string - 作者显示标签
avatarUrl string - 头像图片 URL
hideAuthorName boolean - 隐藏作者显示标签
hideAvatar boolean - 隐藏头像
hideMetadata boolean - 隐藏元数据(时间)
iconPack IconPack1 defaultIconPack 图标包
isEdited boolean - 消息是否已被编辑
isSelf boolean - 消息是否由当前用户发送
messageType Message['type'] - 消息类型
pinned boolean - 消息是否已置顶
time Date - 消息发送时间
variant 'plain' | 'bubble' - 外观
viewType 'incoming' | 'outgoing' - 渲染

使用示例

基本用法

import { RtkMessageView } from '@cloudflare/realtimekit-react-ui';

function MyComponent() {
  return <RtkMessageView />;
}

带有属性

import { RtkMessageView } from '@cloudflare/realtimekit-react-ui';

function MyComponent() {
  return (
    <RtkMessageView
      actions={[]}
      authorName="example"
      avatarUrl="example"
    />
  );
}

这篇文档对您有帮助吗?