diff --git a/Client/src/Pages/Monitors/index.jsx b/Client/src/Pages/Monitors/index.jsx index fbc0413d0..ff8937af3 100644 --- a/Client/src/Pages/Monitors/index.jsx +++ b/Client/src/Pages/Monitors/index.jsx @@ -1,13 +1,25 @@ import CreateNewMonitor from "./CreateNewMonitor"; -// import CurrentStats from "./CurrentStats"; +import CurrentStats from "./CurrentStats"; import "./index.css"; import React from "react"; +import { useEffect } from "react"; +import { useSelector } from "react-redux"; +import { useDispatch } from "react-redux"; +import { getMonitorsByUserId } from "../../Features/Monitors/monitorsSlice"; const Monitors = () => { + const monitorState = useSelector((state) => state.monitors); + const authstate = useSelector((state) => state.auth); + const dispatch = useDispatch(); + + useEffect(() => { + dispatch(getMonitorsByUserId(authstate.authToken)); + }, []); + return (