| 属性 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
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"
/>
);
}