Fix lit files, reallow html alerts

This commit is contained in:
Snarling
2022-09-11 15:20:25 -04:00
parent 88e2cdf09c
commit dc59a10e19
3 changed files with 13 additions and 4 deletions
+10 -2
View File
@@ -3,6 +3,14 @@ import { AlertEvents } from "./AlertManager";
import React from "react";
import { Typography } from "@mui/material";
export function dialogBoxCreate(txt: string | JSX.Element): void {
AlertEvents.emit(typeof txt === "string" ? <Typography component="span">{txt}</Typography> : txt);
export function dialogBoxCreate(txt: string | JSX.Element, html = false): void {
AlertEvents.emit(
typeof txt !== "string" ? (
txt
) : html ? (
<div dangerouslySetInnerHTML={{ __html: txt }}></div>
) : (
<Typography component="span">{txt}</Typography>
),
);
}