MCPcopy Create free account
hub / github.com/Noumena-Network/code / ThinkbackMenu

Function ThinkbackMenu

src/commands/thinkback/thinkback.tsx:272–384  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

270type MenuAction = 'play' | 'edit' | 'fix' | 'regenerate';
271type GenerativeAction = Exclude<MenuAction, 'play'>;
272function ThinkbackMenu(t0) {
273 const $ = _c(19);
274 const {
275 onDone,
276 onAction,
277 skillDir,
278 hasGenerated
279 } = t0;
280 const [hasSelected, setHasSelected] = useState(false);
281 let t1;
282 if ($[0] !== hasGenerated) {
283 t1 = hasGenerated ? [{
284 label: "Play animation",
285 value: "play" as const,
286 description: "Watch your year in review"
287 }, {
288 label: "Edit content",
289 value: "edit" as const,
290 description: "Modify the animation"
291 }, {
292 label: "Fix errors",
293 value: "fix" as const,
294 description: "Fix validation or rendering issues"
295 }, {
296 label: "Regenerate",
297 value: "regenerate" as const,
298 description: "Create a new animation from scratch"
299 }] : [{
300 label: "Let's go!",
301 value: "regenerate" as const,
302 description: "Generate your personalized animation"
303 }];
304 $[0] = hasGenerated;
305 $[1] = t1;
306 } else {
307 t1 = $[1];
308 }
309 const options = t1;
310 let t2;
311 if ($[2] !== onAction || $[3] !== onDone || $[4] !== skillDir) {
312 t2 = function handleSelect(value) {
313 setHasSelected(true);
314 if (value === "play") {
315 playAnimation(skillDir).then(() => {
316 onDone(undefined, {
317 display: "skip"
318 });
319 });
320 } else {
321 onAction(value);
322 }
323 };
324 $[2] = onAction;
325 $[3] = onDone;
326 $[4] = skillDir;
327 $[5] = t2;
328 } else {
329 t2 = $[5];

Callers

nothing calls this directly

Calls 2

playAnimationFunction · 0.85
onDoneFunction · 0.50

Tested by

no test coverage detected