From e38be8d8ec1bdf1c854a2391ae9f4641cb69a249 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Thu, 20 Jan 2022 13:12:28 -0300
Subject: using loadingerror

---
 .../taler-wallet-webextension/src/cta/Withdraw.tsx | 33 +++++++++-------------
 1 file changed, 13 insertions(+), 20 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/cta/Withdraw.tsx')

diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
index 0a06bd577..a4ee640ca 100644
--- a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
@@ -30,6 +30,8 @@ import {
 } from "@gnu-taler/taler-util";
 import { Fragment, h, VNode } from "preact";
 import { useState } from "preact/hooks";
+import { Loading } from "../components/Loading";
+import { LoadingError } from "../components/LoadingError";
 import { LogoHeader } from "../components/LogoHeader";
 import { Part } from "../components/Part";
 import { SelectList } from "../components/SelectList";
@@ -237,19 +239,14 @@ export function WithdrawPageWithParsedURI({
   });
 
   if (!detailsHook) {
-    return (
-      <span>
-        <i18n.Translate>Getting withdrawal details.</i18n.Translate>
-      </span>
-    );
+    return <Loading />;
   }
   if (detailsHook.hasError) {
     return (
-      <span>
-        <i18n.Translate>
-          Problems getting details: {detailsHook.message}
-        </i18n.Translate>
-      </span>
+      <LoadingError
+        title="Could not load the withdrawal details"
+        error={detailsHook}
+      />
     );
   }
 
@@ -315,21 +312,17 @@ export function WithdrawPage({ talerWithdrawUri }: Props): VNode {
     );
   }
   if (!uriInfoHook) {
-    return (
-      <span>
-        <i18n.Translate>Loading...</i18n.Translate>
-      </span>
-    );
+    return <Loading />;
   }
   if (uriInfoHook.hasError) {
     return (
-      <span>
-        <i18n.Translate>
-          This URI is not valid anymore: {uriInfoHook.message}
-        </i18n.Translate>
-      </span>
+      <LoadingError
+        title="Could not get the info from the URI"
+        error={uriInfoHook}
+      />
     );
   }
+
   return (
     <WithdrawPageWithParsedURI
       uri={talerWithdrawUri}
-- 
cgit v1.2.3

