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