@etsoo/toolpad
Version:
Dashboard framework extention based on Toolpad Core
26 lines (25 loc) • 1.08 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import ErrorIcon from "@mui/icons-material/Error";
import CircularProgress from "@mui/material/CircularProgress";
import { styled } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
const OverlayRoot = styled("div")(({ theme }) => ({
position: "absolute",
inset: "0 0 0 0",
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
padding: theme.spacing(2)
}));
export function ErrorOverlay({ error }) {
return (_jsxs(OverlayRoot, { children: [_jsxs(Typography, { variant: "h6", sx: {
display: "flex",
flexDirection: "row",
gap: 1,
alignItems: "center"
}, children: [_jsx(ErrorIcon, { color: "error" }), " Error"] }), _jsx(Typography, { textAlign: "center", children: error?.message ?? "Unknown error" })] }));
}
export function LoadingOverlay() {
return (_jsx(OverlayRoot, { children: _jsx(CircularProgress, {}) }));
}