import { NavLink } from "react-router";
import { useAppDispatch } from '../../app/hooks';
import { logout } from "../../features/auth/authSlice";

const Header = () =>{

    const dispatch = useAppDispatch();

    return(
        <nav className="header">
            <div className="account-menu">
            <NavLink to="/" end >Главная</NavLink>
            <NavLink to="history" >История</NavLink>
            <NavLink to="login" onClick={() => dispatch(logout())} >Выход</NavLink>
            </div>
        </nav>
    )
}

export default Header;