MCPcopy Create free account
hub / github.com/MiniMax-AI/OpenRoom / handleAdd

Function handleAdd

apps/webuiapps/src/components/ChatPanel/ModPanel.tsx:43–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 };
42
43 const handleAdd = () => {
44 const id = generateModId();
45 const newMod: ModConfig = {
46 id,
47 mod_name: 'New Mod',
48 mod_name_en: 'New Mod',
49 mod_description: '',
50 stage_count: 1,
51 stages: {
52 0: {
53 stage_index: 0,
54 stage_name: 'Stage 1',
55 stage_description: '',
56 stage_targets: { 1: 'First target' },
57 },
58 },
59 };
60 const newState: ModState = {
61 current_stage_index: 0,
62 total_stage_count: 1,
63 is_finished: false,
64 completed_targets: [],
65 };
66 setCol({ ...col, items: { ...col.items, [id]: { config: newMod, state: newState } } });
67 setEditingId(id);
68 };
69
70 const handleSave = () => {
71 onSave(col);

Callers

nothing calls this directly

Calls 1

generateModIdFunction · 0.90

Tested by

no test coverage detected