| 1 |
import React from "react"; |
| 2 |
import { createRoot } from "react-dom/client"; |
| 3 |
import { Provider } from "react-redux"; |
| 4 |
import { createStore } from "redux"; |
| 5 |
import { compose } from "recompose"; |
| 6 |
import { initialState, reducers } from "./Store"; |
| 7 |
import withAPI from "./util/withAPI"; |
| 8 |
import { HashRouter, Routes, Route } from "react-router-dom"; |
| 9 |
|
| 10 |
import ServerDashboard from "./components/ServerDashboard/ServerDashboard"; |
| 11 |
import Groups from "./components/Groups/Groups"; |
| 12 |
import GroupEdit from "./components/GroupEdit/GroupEdit"; |
| 13 |
import CreateGroup from "./components/CreateGroup/CreateGroup"; |
| 14 |
import AddUser from "./components/AddUser/AddUser"; |
| 15 |
import EditUser from "./components/EditUser/EditUser"; |
| 16 |
|
| 17 |
import "./style/root.css"; |
| 18 |
|
| 19 |
const store = createStore(reducers, initialState); |
| 20 |
|
| 21 |
const App = () => { |
| 22 |
return ( |
| 23 |
<div className="resets"> |
| 24 |
<Provider store={store}> |
| 25 |
<HashRouter> |
| 26 |
<Routes> |
| 27 |
<Route path="/" element={compose(withAPI)(ServerDashboard)()} /> |
| 28 |
<Route path="/groups" element={compose(withAPI)(Groups)()} /> |
| 29 |
<Route path="/group-edit" element={compose(withAPI)(GroupEdit)()} /> |
| 30 |
<Route |
| 31 |
path="/create-group" |
| 32 |
element={compose(withAPI)(CreateGroup)()} |
| 33 |
/> |
| 34 |
<Route path="/add-users" element={compose(withAPI)(AddUser)()} /> |
| 35 |
<Route path="/edit-user" element={compose(withAPI)(EditUser)()} /> |
| 36 |
</Routes> |
| 37 |
</HashRouter> |
| 38 |
</Provider> |
| 39 |
</div> |
| 40 |
); |
| 41 |
}; |
| 42 |
|
| 43 |
const root = createRoot(document.getElementById("react-admin-hook")); |
| 44 |
root.render(<App />); |