diff options
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/SolveEmailEntry.tsx')
-rw-r--r-- | packages/anastasis-webui/src/pages/home/SolveEmailEntry.tsx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/anastasis-webui/src/pages/home/SolveEmailEntry.tsx b/packages/anastasis-webui/src/pages/home/SolveEmailEntry.tsx new file mode 100644 index 000000000..6296dc022 --- /dev/null +++ b/packages/anastasis-webui/src/pages/home/SolveEmailEntry.tsx @@ -0,0 +1,22 @@ +import { h, VNode } from "preact"; +import { useState } from "preact/hooks"; +import { AnastasisClientFrame, LabeledInput } from "./index"; +import { SolveEntryProps } from "./SolveScreen"; + +export function SolveEmailEntry(props: SolveEntryProps): VNode { + const [answer, setAnswer] = useState(""); + const { reducer, challenge, feedback } = props; + const next = (): void => reducer.transition("solve_challenge", { + answer, + }); + return ( + <AnastasisClientFrame + title="Recovery: Solve challenge" + onNext={() => next()} + > + <p>Feedback: {JSON.stringify(feedback)}</p> + <p>{challenge.instructions}</p> + <LabeledInput label="Answer" grabFocus bind={[answer, setAnswer]} /> + </AnastasisClientFrame> + ); +} |