diff --git a/client/src/common/components/Content/Content.jsx b/client/src/common/components/Content/Content.jsx index a5bbe0d..d461085 100644 --- a/client/src/common/components/Content/Content.jsx +++ b/client/src/common/components/Content/Content.jsx @@ -1,13 +1,21 @@ import "./styles.sass"; -import {routes} from "@/common/routes"; -import {Route, Routes} from "react-router-dom"; +import {getByPath, routes} from "@/common/routes"; +import {Route, Routes, useLocation} from "react-router-dom"; +import {useEffect} from "react"; -export const Content = () => ( -
- - {Object.keys(routes).map((route) => (routes[route].map((route) => ( - - ))))} - -
-) \ No newline at end of file +export const Content = () => { + const location = useLocation(); + + useEffect(() => { + document.title = "PowerTools - " + (getByPath(location.pathname)?.name || "404"); + }, [location]); + + return ( +
+ + {Object.keys(routes).map((route) => (routes[route].map((route) => ( + + ))))} + +
); +} \ No newline at end of file