MCPcopy Create free account
hub / github.com/e2b-dev/surf / handleExampleClick

Function handleExampleClick

app/page.tsx:124–138  ·  view source on GitHub ↗
(prompt: string)

Source from the content-addressed store, hash-verified

122 };
123
124 const handleExampleClick = (prompt: string) => {
125 const width =
126 iFrameWrapperRef.current?.clientWidth ||
127 (window.innerWidth < 768 ? window.innerWidth - 32 : 1024);
128 const height =
129 iFrameWrapperRef.current?.clientHeight ||
130 (window.innerWidth < 768 ? Math.min(window.innerHeight * 0.4, 400) : 768);
131
132 sendMessage({
133 content: prompt,
134 sandboxId: sandboxId || undefined,
135 environment: "linux",
136 resolution: [width, height],
137 });
138 };
139
140 const handleSandboxCreated = (newSandboxId: string, newVncUrl: string) => {
141 setSandboxId(newSandboxId);

Callers

nothing calls this directly

Calls 1

sendMessageFunction · 0.85

Tested by

no test coverage detected