mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-10-23 18:23:15 +02:00
8a2cad6c4a
Adds an optional sxProps to the DialogBox component.
14 lines
429 B
TypeScript
14 lines
429 B
TypeScript
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);
|
|
} else {
|
|
AlertEvents.emit(<Typography component="span" sx={styles} dangerouslySetInnerHTML={{ __html: txt }} />);
|
|
}
|
|
}
|