import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import Login from "./pages/login/Login";
import Measure from "./pages/measure/Measure";
import MeasureConfig from "./pages/measure/components/MeasureConfig";
import MeasureDetail from "./pages/measure/components/MeasureDetail";
import MeasureAction from "./pages/measure/components/MeasureAction";
import App from "./App";
import reportWebVitals from "./reportWebVitals";

const router = createBrowserRouter([
	{
		path: "/",
		element: <App />,
		children: [
			{
				path: "measure",
				element: <Measure />,
				children: [
					{
						path: "config",
						element: <MeasureConfig />,
					},
					{
						path: "detail",
						element: <MeasureDetail />,
					},
					{
						path: "action",
						element: <MeasureAction />,
					},
				],
			},
		],
	},
	{
		path: "/login",
		element: <Login />,
	},
]);

const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
root.render(
	<React.StrictMode>
		<RouterProvider router={router} />
	</React.StrictMode>
);

console.log(process.env.REACT_APP_WS_URL);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
