Files
Checkmate/Client/src/Pages/Monitors/index.jsx
T

25 lines
727 B
React
Raw Normal View History

2024-06-20 21:47:07 +03:30
// import CreateNewMonitor from "./CreateNewMonitor";
import CurrentStats from "./CurrentStats";
2024-06-05 21:09:14 +03:30
import "./index.css";
2024-06-21 11:08:31 -07:00
import { useEffect } from "react";
import { useSelector } from "react-redux";
import { useDispatch } from "react-redux";
import { getMonitorsByUserId } from "../../Features/Monitors/monitorsSlice";
const Monitors = () => {
2024-06-21 11:08:31 -07:00
const monitorState = useSelector((state) => state.monitors);
const authstate = useSelector((state) => state.auth);
const dispatch = useDispatch();
useEffect(() => {
dispatch(getMonitorsByUserId(authstate.authToken));
}, []);
2024-06-05 21:09:14 +03:30
return (
<div className="monitors">
2024-06-21 11:08:31 -07:00
<CurrentStats monitors={monitorState.monitors} />
2024-06-05 21:09:14 +03:30
</div>
);
};
2024-06-05 21:09:14 +03:30
export default Monitors;