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

34 lines
991 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 {
const reducer = useAnastasisContext()
if (!reducer) {
return <div>no reducer in context</div>
}
if (!reducer.currentReducerState || reducer.currentReducerState.backup_state === undefined) {
return <div>invalid state</div>
}
const payments = reducer.currentReducerState.payments ?? [];
2021-10-19 15:56:52 +02:00
return (
<AnastasisClientFrame
hideNext
title="Backup: Authentication Storage Payments"
>
<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>
);
}