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

31 lines
937 B
TypeScript
Raw Normal View History

2021-10-19 15:56:52 +02:00
import { h, VNode } from "preact";
2021-10-22 06:31:46 +02:00
import { useAnastasisContext } from "../../context/anastasis";
import { AnastasisClientFrame } from "./index";
2021-10-19 15:56:52 +02:00
2021-10-22 06:31:46 +02:00
export function TruthsPayingScreen(): VNode {
2021-11-10 14:20:52 +01:00
const reducer = useAnastasisContext();
2021-10-22 06:31:46 +02:00
if (!reducer) {
2021-11-10 14:20:52 +01:00
return <div>no reducer in context</div>;
2021-10-22 06:31:46 +02:00
}
2022-04-13 08:44:37 +02:00
if (reducer.currentReducerState?.reducer_type !== "backup") {
2021-11-10 14:20:52 +01:00
return <div>invalid state</div>;
2021-10-22 06:31:46 +02:00
}
const payments = reducer.currentReducerState.payments ?? [];
2021-10-19 15:56:52 +02:00
return (
2021-11-10 14:20:52 +01:00
<AnastasisClientFrame hideNext={"FIXME"} title="Backup: Truths Paying">
2021-10-19 15:56:52 +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>
2021-10-22 06:31:46 +02:00
<button onClick={() => reducer.transition("pay", {})}>
2021-10-19 15:56:52 +02:00
Check payment status now
</button>
</AnastasisClientFrame>
);
}