@etsoo/materialui
Version:
TypeScript Material-UI Implementation
23 lines (22 loc) • 796 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ErrorAlert = ErrorAlert;
const jsx_runtime_1 = require("react/jsx-runtime");
const Alert_1 = __importDefault(require("@mui/material/Alert"));
const ReactApp_1 = require("./app/ReactApp");
/**
* Error alert component
* @param props Props
* @returns Component
*/
function ErrorAlert(props) {
// Global app
const app = (0, ReactApp_1.useAppContext)();
// Destruct
const { message = app?.get("idError"), ...alertProps } = props;
// Layout
return ((0, jsx_runtime_1.jsx)(Alert_1.default, { severity: "error", ...alertProps, children: message }));
}