2021-10-26 17:08:03 +02:00
|
|
|
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();
|
2021-10-26 17:08:03 +02:00
|
|
|
if (!reducer) {
|
2021-11-10 14:20:52 +01:00
|
|
|
return <div>no reducer in context</div>;
|
2021-10-26 17:08:03 +02:00
|
|
|
}
|
2022-04-13 08:44:37 +02:00
|
|
|
if (reducer.currentReducerState?.reducer_type !== "recovery") {
|
2021-11-10 14:20:52 +01:00
|
|
|
return <div>invalid state</div>;
|
2021-10-26 17:08:03 +02:00
|
|
|
}
|
2021-11-10 14:20:52 +01:00
|
|
|
const payments = [""]; //reducer.currentReducerState.payments ??
|
2021-10-26 17:08:03 +02:00
|
|
|
return (
|
2021-11-10 14:20:52 +01:00
|
|
|
<AnastasisClientFrame hideNav title="Recovery: Challenge Paying">
|
2021-10-26 17:08:03 +02:00
|
|
|
<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>
|
|
|
|
);
|
|
|
|
}
|