import { TranslatedString, assertUnreachable } from "@gnu-taler/taler-util"; import { ComponentChildren, Fragment, VNode, h } from "preact"; interface Props { type?: "info" | "success" | "warning" | "danger", onClose?: () => void, title: TranslatedString, children?: ComponentChildren, } export function Attention({ type = "info", title, children, onClose }: Props): VNode { return
{(() => { switch (type) { case "info": return case "warning": return case "danger": return case "success": return default: assertUnreachable(type) } })()}

{title}

{children}
{onClose &&
}
}