From 0cf52a2812dd0cfab9bfdf2dcd81fe4787f4dcb0 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Mon, 12 Jul 2021 14:47:13 -0300
Subject: styles for provider detail page

---
 .../src/components/ErrorMessage.tsx                    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 packages/taler-wallet-webextension/src/components/ErrorMessage.tsx

(limited to 'packages/taler-wallet-webextension/src/components/ErrorMessage.tsx')

diff --git a/packages/taler-wallet-webextension/src/components/ErrorMessage.tsx b/packages/taler-wallet-webextension/src/components/ErrorMessage.tsx
new file mode 100644
index 000000000..eaf015224
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/components/ErrorMessage.tsx
@@ -0,0 +1,18 @@
+import { useState } from "preact/hooks";
+import arrowDown from '../../static/img/chevron-down.svg';
+import { ErrorBox } from "./styled";
+
+export function ErrorMessage({ title, description }: { title?: string; description?: string; }) {
+  const [showErrorDetail, setShowErrorDetail] = useState(false);
+  if (!title)
+    return null;
+  return <ErrorBox>
+    <div>
+      <p>{title}</p>
+      { description && <button onClick={() => { setShowErrorDetail(v => !v); }}>
+        <img style={{ height: '1.5em' }} src={arrowDown} />
+      </button> }
+    </div>
+    {showErrorDetail && <p>{description}</p>}
+  </ErrorBox>;
+}
-- 
cgit v1.2.3

