mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-05 23:27:55 +02:00
23 lines
565 B
TypeScript
23 lines
565 B
TypeScript
import { AlertEvents } from "./AlertManager";
|
|
|
|
import React from "react";
|
|
import { Typography } from "@mui/material";
|
|
|
|
export function dialogBoxCreate(
|
|
txt: string | JSX.Element,
|
|
{ html, canBeDismissedEasily } = { html: false, canBeDismissedEasily: true },
|
|
): void {
|
|
AlertEvents.emit(
|
|
typeof txt !== "string" ? (
|
|
txt
|
|
) : html ? (
|
|
<div dangerouslySetInnerHTML={{ __html: txt }}></div>
|
|
) : (
|
|
<Typography component="span" style={{ whiteSpace: "pre-wrap" }}>
|
|
{txt}
|
|
</Typography>
|
|
),
|
|
canBeDismissedEasily,
|
|
);
|
|
}
|