feat: 增加视觉模板预览卡片

This commit is contained in:
que01 committed 2026-09-22 23:47:16 +08:00
1 parent 6e8a49162c
commit 4c9f9a05d0
3 files changed
+29 -2

No files matched your search

@@ -233,6 +233,32 @@ export function WorkspacePage() {
) : null}
<MutationError error={rollbackVisual.error} />
</Space>
<Space direction="vertical" style={{ width: "100%" }}>
<Typography.Text strong>可用视觉模板</Typography.Text>
<Space wrap>
{(templateCatalog.data?.visuals ?? []).map((visual) => (
<Card key={visual.key} size="small" style={{ width: 260 }}>
<Typography.Text strong>{visual.name}</Typography.Text>
<Typography.Paragraph type="secondary" ellipsis={{ rows: 2 }}>
{visual.description}
</Typography.Paragraph>
<Space wrap>
{Object.entries(visual.theme.colors).map(([name, color]) => (
<Tag key={name} color={color.startsWith("#") ? "default" : "blue"}>
{name}
</Tag>
))}
</Space>
<Typography.Paragraph
type="secondary"
style={{ marginTop: 12, marginBottom: 0 }}
>
{Object.values(visual.variants).join(" / ")}
</Typography.Paragraph>
</Card>
))}
</Space>
</Space>
<Modal
title="确认切换视觉模板"
open={visualTarget !== null}