import { AlertTitle } from "@mui/material";
import MuiAlert from "@mui/material/Alert";
import CssBaseline from "@mui/material/CssBaseline";
import Slide from "@mui/material/Slide";
import Snackbar from "@mui/material/Snackbar";
import * as Sentry from "@sentry/react";
import { Outlet, useModel } from "@umijs/max";
import React from "react";
import ThemeProvider from "./theme";
// 自定义主题
// const { palette } = useTheme();
// const theme = useMemo(() => {
// return createTheme(curthemeconfig);
// }, [curthemeconfig]);
{
/*
{
if (curthemeconfig.palette.mode == "dark") {
dispatch(changetheme("lightTheme"));
} else {
dispatch(changetheme("darkTheme"));
}
}}
>
{curthemeconfig.palette.mode !== "dark" ? (
) : (
)}
*/
}
Sentry.init({
dsn: "http://38a2decfe9214e639164d2ca6ef92a67@iot-dev.nangaoyun.com:9000/9",
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()],
enabled: process.env.NODE_ENV !== "development",
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
// Capture Replay for 10% of all sessions,
// plus for 100% of sessions with an error
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
});
Sentry.configureScope(function (scope) {
scope.setLevel("error");
});
const Alert = React.forwardRef(function Alert(props, ref) {
return ;
});
function App() {
const handleClose = (event) => {
setInitialState((s) => ({
...s,
message: {
...message,
open: false,
},
}));
};
const {
initialState: { message },
setInitialState,
} = useModel("@@initialState");
return (
}
{...message?.snackbar}
onClose={handleClose}
>
{message?.title ? {message?.title} : null}
{message?.content}
);
}
export default App;