(event: KeyboardEvent)
| 65 | |
| 66 | useEffect(() => { |
| 67 | const onKey = (event: KeyboardEvent) => { |
| 68 | if (event.key !== "[" && event.key !== "]") return; |
| 69 | const index = flowSteps.findIndex((candidate) => candidate.id === stepId); |
| 70 | const next = event.key === "]" ? index + 1 : index - 1; |
| 71 | const target = flowSteps[next]; |
| 72 | if (target) goToStep(target.id); |
| 73 | }; |
| 74 | globalThis.addEventListener("keydown", onKey); |
| 75 | return () => globalThis.removeEventListener("keydown", onKey); |
| 76 | }, [stepId, goToStep]); |
nothing calls this directly
no outgoing calls
no test coverage detected