30 lines
812 B
JavaScript
30 lines
812 B
JavaScript
import { useEffect } from 'react';
|
|
import { useRouter } from 'next/router';
|
|
|
|
export default function Dashboard() {
|
|
const router = useRouter();
|
|
|
|
useEffect(() => {
|
|
const token = localStorage.getItem('token');
|
|
if (!token) {
|
|
// redirect to login if not authenticated
|
|
router.push('/');
|
|
}
|
|
}, [router]);
|
|
|
|
const handleLogout = () => {
|
|
localStorage.removeItem('token');
|
|
router.push('/');
|
|
};
|
|
|
|
return (
|
|
<div style={{ padding: '2rem', textAlign: 'center' }}>
|
|
<h1>Expedição Gold</h1>
|
|
<p>Área do jogador - Em construção</p>
|
|
<p>Em breve: investir em expedições terrestres, marítimas, espirituais e cósmicas.</p>
|
|
<button onClick={handleLogout} style={{ marginTop: '1.5rem', padding: '0.5rem 1rem' }}>
|
|
Sair
|
|
</button>
|
|
</div>
|
|
);
|
|
} |