import { h, Fragment, VNode, JSX } from "preact"; import { Divider } from "../mui/Divider.js"; import { Button } from "../mui/Button.js"; import { Typography } from "../mui/Typography.js"; import { Avatar } from "../mui/Avatar.js"; import { Grid } from "../mui/Grid.js"; import { Paper } from "../mui/Paper.js"; interface Props extends JSX.HTMLAttributes { title?: string; elements: { icon?: VNode; description: VNode; action?: () => void; }[]; confirm?: { label: string; action: () => Promise; }; } export function Banner({ title, elements, confirm, ...rest }: Props): VNode { return ( {title && ( {title} )} {elements.map((e, i) => ( {e.icon && ( {e.icon} )} {e.description} ))} {confirm && ( )} ); } export default Banner;