h.JSX.Element> = {
question: SolveQuestionEntry,
sms: SolveSmsEntry,
email: SolveEmailEntry,
post: SolvePostEntry,
};
const SolveDialog = selectedChallenge === undefined ? SolveUndefinedEntry : dialogMap[selectedChallenge.type] ?? SolveUnsupportedEntry;
function onNext(): void {
reducer?.transition("solve_challenge", { answer })
}
function onCancel(): void {
reducer?.back()
}
return (
);
}
export interface SolveEntryProps {
id: string;
challenge: ChallengeInfo;
feedback?: ChallengeFeedback;
answer: string;
setAnswer: (s:string) => void;
}
function SolveSmsEntry({ challenge, answer, setAnswer }: SolveEntryProps): VNode {
return (
An sms has been sent to "{challenge.instructions}". Type the code below
);
}
function SolveQuestionEntry({ challenge, answer, setAnswer }: SolveEntryProps): VNode {
return (
Type the answer to the following question:
{challenge.instructions}
);
}
function SolvePostEntry({ challenge, answer, setAnswer }: SolveEntryProps): VNode {
return (
instruction for post type challenge "{challenge.instructions}"
);
}
function SolveEmailEntry({ challenge, answer, setAnswer }: SolveEntryProps): VNode {
return (
An email has been sent to "{challenge.instructions}". Type the code below
);
}
function SolveUnsupportedEntry(props: SolveEntryProps): VNode {
return (
The challenge selected is not supported for this UI. Please update this version or try using another policy.
Challenge type: {props.challenge.type}
);
}
function SolveUndefinedEntry(props: SolveEntryProps): VNode {
return (
There is no challenge information for id "{props.id}". Try resetting the recovery session.
);
}