SolarEnergy/central_frontend/src/main.tsx

41 lines
1.7 KiB
TypeScript
Raw Normal View History

2024-06-29 11:01:50 +00:00
import "@fontsource/roboto/300.css";
import "@fontsource/roboto/400.css";
import "@fontsource/roboto/500.css";
import "@fontsource/roboto/700.css";
2024-06-29 11:26:12 +00:00
import React from "react";
import ReactDOM from "react-dom/client";
import { App } from "./App";
import { AlertDialogProvider } from "./hooks/context_providers/AlertDialogProvider";
import { ConfirmDialogProvider } from "./hooks/context_providers/ConfirmDialogProvider";
import { DarkThemeProvider } from "./hooks/context_providers/DarkThemeProvider";
import { LoadingMessageProvider } from "./hooks/context_providers/LoadingMessageProvider";
import { SnackbarProvider } from "./hooks/context_providers/SnackbarProvider";
import "./index.css";
2024-06-29 12:43:56 +00:00
import { ServerApi } from "./api/ServerApi";
import { AsyncWidget } from "./widgets/AsyncWidget";
2024-07-29 20:11:13 +00:00
import { LocalizationProvider } from "@mui/x-date-pickers";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
2024-06-29 11:01:50 +00:00
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
2024-07-29 20:11:13 +00:00
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DarkThemeProvider>
<AlertDialogProvider>
<ConfirmDialogProvider>
<SnackbarProvider>
<LoadingMessageProvider>
<AsyncWidget
loadKey={1}
load={async () => await ServerApi.LoadConfig()}
errMsg="Failed to connect to backend to retrieve static config!"
build={() => <App />}
/>
</LoadingMessageProvider>
</SnackbarProvider>
</ConfirmDialogProvider>
</AlertDialogProvider>
</DarkThemeProvider>
</LocalizationProvider>
2024-06-29 11:01:50 +00:00
</React.StrictMode>
);