bitburner-src/src/ui/React/DialogBox.tsx

17 lines
417 B
TypeScript
Raw Normal View History

import { AlertEvents } from "./AlertManager";
import React from "react";
import { Typography } from "@mui/material";
2022-09-11 21:20:25 +02:00
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>
),
);
2022-08-28 11:33:38 +02:00
}