From 5883d42d800c7b444c59d626bcaa5abca7dc83d0 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Tue, 19 Oct 2021 10:56:52 -0300
Subject: add template from merchant backoffice

---
 .../src/pages/home/ReviewPoliciesScreen.tsx        | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 packages/anastasis-webui/src/pages/home/ReviewPoliciesScreen.tsx

(limited to 'packages/anastasis-webui/src/pages/home/ReviewPoliciesScreen.tsx')

diff --git a/packages/anastasis-webui/src/pages/home/ReviewPoliciesScreen.tsx b/packages/anastasis-webui/src/pages/home/ReviewPoliciesScreen.tsx
new file mode 100644
index 000000000..b898bb39e
--- /dev/null
+++ b/packages/anastasis-webui/src/pages/home/ReviewPoliciesScreen.tsx
@@ -0,0 +1,43 @@
+/* eslint-disable @typescript-eslint/camelcase */
+import { h, VNode } from "preact";
+import { BackupReducerProps, AnastasisClientFrame } from "./index";
+
+export function ReviewPoliciesScreen(props: BackupReducerProps): VNode {
+  const { reducer, backupState } = props;
+  const authMethods = backupState.authentication_methods!;
+  return (
+    <AnastasisClientFrame title="Backup: Review Recovery Policies">
+      {backupState.policies?.map((p, i) => {
+        const policyName = p.methods
+          .map((x, i) => authMethods[x.authentication_method].type)
+          .join(" + ");
+        return (
+          <div key={i}>
+          {/* <div key={i} class={style.policy}> */}
+            <h3>
+              Policy #{i + 1}: {policyName}
+            </h3>
+            Required Authentications:
+            <ul>
+              {p.methods.map((x, i) => {
+                const m = authMethods[x.authentication_method];
+                return (
+                  <li key={i}>
+                    {m.type} ({m.instructions}) at provider {x.provider}
+                  </li>
+                );
+              })}
+            </ul>
+            <div>
+              <button
+                onClick={() => reducer.transition("delete_policy", { policy_index: i })}
+              >
+                Delete Policy
+              </button>
+            </div>
+          </div>
+        );
+      })}
+    </AnastasisClientFrame>
+  );
+}
-- 
cgit v1.2.3

