diff options
author | Sebastian <sebasjm@gmail.com> | 2021-07-12 14:47:13 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-07-12 14:48:59 -0300 |
commit | 0cf52a2812dd0cfab9bfdf2dcd81fe4787f4dcb0 (patch) | |
tree | 79b4049999cadd4e324b54a177990bc1ea4d09d6 /packages/taler-wallet-webextension/src/components/ErrorMessage.tsx | |
parent | 1c0cce3f5812cd2796ab9693b47f035427ca5340 (diff) | |
download | wallet-core-0cf52a2812dd0cfab9bfdf2dcd81fe4787f4dcb0.tar.xz |
styles for provider detail page
Diffstat (limited to 'packages/taler-wallet-webextension/src/components/ErrorMessage.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/components/ErrorMessage.tsx | 18 |
1 files changed, 18 insertions, 0 deletions
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>; +} |