x
This commit is contained in:
1 parent
2a9dd8ddec
commit
de09293051
6 files changed
+80
-16
No files matched your search
@@ -76,6 +76,7 @@ Renderer จะอ่าน `componentId` แล้วไปหา component จ
|
||||
"ko": "매일 구운 식빵, 사워도우, 부드러운 샌드위치 브레드."
|
||||
},
|
||||
"href": "/shop",
|
||||
"icon": "bakery",
|
||||
"imageUrl": "https://example.com/bread.jpg"
|
||||
}
|
||||
]
|
||||
@@ -88,6 +89,7 @@ Renderer จะอ่าน `componentId` แล้วไปหา component จ
|
||||
- ใช้ language keys ชุดเดียวกับระบบ: `th`, `en`, `ja`, `zh`, `vi`, `ko`
|
||||
- field ที่เป็นข้อความควรรองรับ localized object เสมอ
|
||||
- field ที่เป็น route หรือ URL เช่น `href`, `imageUrl` เป็น string ปกติ
|
||||
- `icon` เป็น optional string สำหรับเลือก line icon ในวงกลม เช่น `dessert`, `bakery`, `cake`, `gift`, `cookie`, `bread`
|
||||
- `imageUrl` เป็น optional ถ้าไม่ใส่ component ต้องมี fallback ที่หน้าไม่พัง
|
||||
|
||||
## Step 2: เพิ่ม Shared Type
|
||||
@@ -353,6 +355,7 @@ type BakeryCategory = {
|
||||
description?: string | Record<string, string>
|
||||
href: string
|
||||
imageUrl?: string
|
||||
icon?: string
|
||||
}
|
||||
```
|
||||
|
||||
@@ -381,7 +384,7 @@ apps/mcp-server/section-toolkit.ts
|
||||
```ts
|
||||
CUSTOM: {
|
||||
required: ["componentId"],
|
||||
example: `{ "componentId": "BakeryCategories", "props": { "title": ${localizedStringExample}, "subtitle": ${localizedStringExample}, "layout": "horizontal", "items": [{ "title": ${localizedStringExample}, "description": ${localizedStringExample}, "href": "/shop" }] } }`
|
||||
example: `{ "componentId": "BakeryCategories", "props": { "title": ${localizedStringExample}, "subtitle": ${localizedStringExample}, "layout": "horizontal", "items": [{ "title": ${localizedStringExample}, "description": ${localizedStringExample}, "href": "/shop", "icon": "bakery" }] } }`
|
||||
}
|
||||
```
|
||||
|
||||
@@ -512,4 +515,3 @@ Admin Page Builder
|
||||
-> BakeryCategories resolves language
|
||||
-> UI renders cards
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user