View event(查看日程)
紧凑的单条日程卡片显示日期、会议时间和地点。
loading
安装
bash
npm install @assistant-ui/generative-ui zod1
用法
将下方规格传给渲染器。此规格包含完整的展示数据,渲染时使用已完成状态。
tsx
import { defaultGenerativeUILibrary, renderGenerativeUI } from "@assistant-ui/generative-ui/react";
renderGenerativeUI(spec, defaultGenerativeUILibrary, { status: "done" });1
2
3
2
3
规格
tsx
const spec = {
"$type": "Card",
"children": [
{
"$type": "Caption",
"$key": "date",
"value": "7 月 24 日,星期五"
},
{
"$type": "Header",
"$key": "title",
"text": "设计评审",
"size": "md"
},
{
"$type": "Caption",
"$key": "time",
"value": "09:00 至 09:30 · B 会议室"
}
]
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21