MCPcopy
hub / github.com/bbycroft/llm-viz / onCreateEditClicked

Function onCreateEditClicked

src/cpu/CompLayoutEditor.tsx:69–83  ·  view source on GitHub ↗
(ev: React.MouseEvent)

Source from the content-addressed store, hash-verified

67 }, [editorState.snapshot]);
68
69 function onCreateEditClicked(ev: React.MouseEvent) {
70 setIsExpanded(a => !a);
71 if (!hasComponent) {
72 setEditorState(editSnapshot(true, (snap, state) => {
73 return assignImm(snap, {
74 mainSchematic: assignImm(snap.mainSchematic, {
75 compSize: new Vec3(4, 4),
76 }),
77 });
78 }));
79 }
80
81 ev.preventDefault();
82 ev.stopPropagation();
83 }
84
85 return <div className={clsx("flex flex-col bg-white shadow-md border m-6 rounded items-stretch overflow-hidden", className)}>
86 <div className='flex flex-row h-10'>

Callers

nothing calls this directly

Calls 4

editSnapshotFunction · 0.90
assignImmFunction · 0.90
preventDefaultMethod · 0.65
stopPropagationMethod · 0.65

Tested by

no test coverage detected