import { useNavigate } from 'react-router-dom';
import { useEffect } from 'react';
import { AuthService } from '../../services';

function Home() {
	const navigate = useNavigate();
	useEffect(() => {
		if (localStorage.getItem('user') && localStorage.getItem('token')) {
			if (AuthService.canViewDashboard()) {
				navigate('/dashboard/dashboard');
				return;
			}
			navigate('/home-empty');
		}
	})
  
  return <></>
}

export default Home;