'use client' import { useRouter } from 'next/navigation' import React, { useEffect, useState } from 'react' import styles from './NavigationButtons.module.css' import { Icon } from '../../atoms' import { getGlobalStyle } from '../../../helpers' export const NavigationButtons: React.FC = () => { const router = useRouter() const [canGoBack, setCanGoBack] = useState(false) useEffect(() => { const updateNavState = (): void => { setCanGoBack(window.history.length > 1) } updateNavState() window.addEventListener('popstate', updateNavState) return () => window.removeEventListener('popstate', updateNavState) }, []) const handleBack = (): void => { router.back() } const handleForward = (): void => { window.history.forward() } return (
) }