summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/components/Banner.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/components/Banner.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/components/Banner.tsx40
1 files changed, 11 insertions, 29 deletions
diff --git a/packages/taler-wallet-webextension/src/components/Banner.tsx b/packages/taler-wallet-webextension/src/components/Banner.tsx
index f95647d42..a91fd384f 100644
--- a/packages/taler-wallet-webextension/src/components/Banner.tsx
+++ b/packages/taler-wallet-webextension/src/components/Banner.tsx
@@ -13,21 +13,20 @@
You should have received a copy of the GNU General Public License along with
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-import { h, Fragment, VNode, JSX } from "preact";
-import { Divider } from "../mui/Divider.js";
+import { ComponentChildren, Fragment, h, JSX, VNode } from "preact";
import { Button } from "../mui/Button.js";
-import { Typography } from "../mui/Typography.js";
-import { Avatar } from "../mui/Avatar.js";
+import { Divider } from "../mui/Divider.js";
import { Grid } from "../mui/Grid.js";
import { Paper } from "../mui/Paper.js";
interface Props extends JSX.HTMLAttributes<HTMLDivElement> {
titleHead?: VNode;
- elements: {
- icon?: VNode;
- description: VNode;
- action?: () => void;
- }[];
+ children: ComponentChildren;
+ // elements: {
+ // icon?: VNode;
+ // description: VNode;
+ // action?: () => void;
+ // }[];
confirm?: {
label: string;
action: () => Promise<void>;
@@ -36,8 +35,9 @@ interface Props extends JSX.HTMLAttributes<HTMLDivElement> {
export function Banner({
titleHead,
- elements,
+ children,
confirm,
+ href,
...rest
}: Props): VNode {
return (
@@ -49,25 +49,7 @@ export function Banner({
</Grid>
)}
<Grid container columns={1}>
- {elements.map((e, i) => (
- <Grid
- container
- item
- xs={1}
- key={i}
- wrap="nowrap"
- spacing={1}
- alignItems="center"
- onClick={e.action}
- >
- {e.icon && (
- <Grid item xs={"auto"}>
- <Avatar>{e.icon}</Avatar>
- </Grid>
- )}
- <Grid item>{e.description}</Grid>
- </Grid>
- ))}
+ {children}
</Grid>
{confirm && (
<Grid container justifyContent="flex-end" spacing={8}>