diff --git a/src/components/atoms/titleLogger.tsx b/src/components/atoms/titleLogger.tsx deleted file mode 100644 index b9a2d8075..000000000 --- a/src/components/atoms/titleLogger.tsx +++ /dev/null @@ -1,31 +0,0 @@ -// components/TitleLogger.tsx -import { useRouter } from 'next/router'; -import { useEffect, useState } from 'react'; - -function TitleLogger() { - const router = useRouter(); - const [currentTitle, setCurrentTitle] = useState(null); - - useEffect(() => { - const handleRouteChange = () => { - // Access the current title - const newTitle = document.querySelector('title')?.text; - setCurrentTitle(newTitle || null); - }; - - // Listen for route changes - router.events.on('routeChangeComplete', handleRouteChange); - - // Initial title - handleRouteChange(); - - // Remove the event listener on component unmount - return () => { - router.events.off('routeChangeComplete', handleRouteChange); - }; - }, [router.events]); - - return { currentTitle }; -} - -export default TitleLogger;