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
|
2021-10-26 17:08:03 +02:00
|
|
|
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>
|
|
|
|
);
|
|
|
|
}
|