wallet-core/packages/anastasis-webui/src/pages/home/ChallengePayingScreen.tsx

34 lines
984 B
TypeScript
Raw Normal View History

import { h, VNode } from "preact";
import { useAnastasisContext } from "../../context/anastasis";
import { AnastasisClientFrame } from "./index";
export function ChallengePayingScreen(): VNode {
2021-11-10 14:20:52 +01:00
const reducer = useAnastasisContext();
if (!reducer) {
2021-11-10 14:20:52 +01:00
return <div>no reducer in context</div>;
}
2021-11-10 14:20:52 +01:00
if (
!reducer.currentReducerState ||
reducer.currentReducerState.recovery_state === undefined
) {
return <div>invalid state</div>;
}
2021-11-10 14:20:52 +01:00
const payments = [""]; //reducer.currentReducerState.payments ??
return (
2021-11-10 14:20:52 +01:00
<AnastasisClientFrame hideNav title="Recovery: Challenge Paying">
<p>
Some of the providers require a payment to store the encrypted
authentication information.
</p>
<ul>
{payments.map((x, i) => {
return <li key={i}>{x}</li>;
})}
</ul>
<button onClick={() => reducer.transition("pay", {})}>
Check payment status now
</button>
</AnastasisClientFrame>
);
}