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

14 lines
429 B
TypeScript
Raw Normal View History

import { AlertEvents } from "./AlertManager";
import React from "react";
import { SxProps } from "@mui/system";
import { Typography } from "@mui/material";
export function dialogBoxCreate(txt: string | JSX.Element, styles?: SxProps): void {
if (typeof txt !== "string") {
AlertEvents.emit(txt);
2021-09-05 01:09:30 +02:00
} else {
AlertEvents.emit(<Typography component="span" sx={styles} dangerouslySetInnerHTML={{ __html: txt }} />);
2021-09-05 01:09:30 +02:00
}
}