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 BackupFinishedScreen(): 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 details = reducer.currentReducerState.success_details
|
2021-10-19 15:56:52 +02:00
|
|
|
return (<AnastasisClientFrame hideNext title="Backup finished">
|
|
|
|
<p>
|
2021-10-22 06:31:46 +02:00
|
|
|
Your backup of secret "{reducer.currentReducerState.secret_name ?? "??"}" was
|
2021-10-19 15:56:52 +02:00
|
|
|
successful.
|
|
|
|
</p>
|
|
|
|
<p>The backup is stored by the following providers:</p>
|
2021-10-22 06:31:46 +02:00
|
|
|
|
|
|
|
{details && <ul>
|
|
|
|
{Object.keys(details).map((x, i) => {
|
|
|
|
const sd = details[x];
|
2021-10-19 15:56:52 +02:00
|
|
|
return (
|
|
|
|
<li key={i}>
|
|
|
|
{x} (Policy version {sd.policy_version})
|
|
|
|
</li>
|
|
|
|
);
|
|
|
|
})}
|
2021-10-22 06:31:46 +02:00
|
|
|
</ul>}
|
|
|
|
<button onClick={() => reducer.reset()}>Back to start</button>
|
2021-10-19 15:56:52 +02:00
|
|
|
</AnastasisClientFrame>);
|
|
|
|
}
|