diff --git a/components/admin/guide-section-editor.tsx b/components/admin/guide-section-editor.tsx index 87aaccf..afa30f5 100644 --- a/components/admin/guide-section-editor.tsx +++ b/components/admin/guide-section-editor.tsx @@ -220,6 +220,7 @@ type WeaponValue = { }; type WeaponGroupValue = { id: string; + name: string | null; note: string | null; rows: WeaponValue[]; }; @@ -1105,9 +1106,10 @@ function WeaponEditor({ guide, weapons, characters, initial }: EditorBase) { const [groups, setGroups] = useState(() => { const source = initial.weaponGroups.length ? initial.weaponGroups - : [{ id: "weapon-condition-default", note: null, rows: [] }]; + : [{ id: "weapon-condition-default", name: null, note: null, rows: [] }]; return source.map((group) => ({ clientId: group.id, + name: group.name ?? "", note: group.note ?? "", rows: group.rows.map((row) => ({ clientId: row.id, @@ -1128,6 +1130,7 @@ function WeaponEditor({ guide, weapons, characters, initial }: EditorBase) { const value = { note: note.trim() || null, groups: groups.map((group) => ({ + name: group.name.trim() || null, note: group.note.trim() || null, rows: group.rows.map((row) => ({ weaponKey: row.weaponKey, @@ -1157,7 +1160,7 @@ function WeaponEditor({ guide, weapons, characters, initial }: EditorBase) { parseEditorDraft(candidate, ["groups"], ["note"]), restoreLocalDraft: (draft) => { setNote(draft.note); - setGroups(draft.groups); + setGroups(draft.groups.map((group) => ({ ...group, name: group.name ?? "" }))); setActiveGroupIndex(draft.activeGroupIndex ?? 0); }, }); @@ -1190,13 +1193,26 @@ function WeaponEditor({ guide, weapons, characters, initial }: EditorBase) { />
- {groups.map((group, index) => ( - - ))} + { + if (values[0]) setActiveGroupIndex(Number(values[0])); + }} + > + {groups.map((group, index) => ( + + {group.name.trim() || `Condition ${index + 1}`} + + ))} +
+ + + Condition name (optional) + + setGroups(groups.map((group, index) => index === activeGroupIndex ? { ...group, name: event.target.value } : group))} + /> + Condition note (optional) @@ -1706,7 +1735,8 @@ function ArtifactEditor({ }; return (
- +
+ Artifact tier list @@ -1714,7 +1744,7 @@ function ArtifactEditor({ ระบบจะบันทึกอัตโนมัติ - + {groups.map((group, groupIndex) => ( @@ -1964,16 +1994,13 @@ function ArtifactEditor({ ))} - - + + Recommended Stats - - เลือกค่าจากรายการแทนปุ่ม และเลือก Main Stat ได้สูงสุด 3 ค่าต่อชิ้น - -
+
+ + + + + + Target Stats + + ตั้งค่าเป้าหมายค่าสถานะสำหรับแต่ละ Condition + + + +
Target Stats
- {targetGroups.map((group, index) => ( - - ))} + { + if (values[0]) setActiveTargetGroupIndex(Number(values[0])); + }}> + {targetGroups.map((group, index) => ( + + Condition {index + 1} + + ))} + ) : null}
+
+
+
+
+ + + Talent Upgrade + + จัดลำดับ Talent เลือกระดับเป้าหมาย และกำหนดความสำคัญ + + + +
Talent Priority
+
+
+
+ + + Note (optional)