feat(web): add landing page

This commit is contained in:
2025-01-07 12:00:00 -05:00
parent d6ac0ddd3a
commit f635386b4d

29
web/app/page.tsx Normal file
View File

@@ -0,0 +1,29 @@
'use client';
import { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
export default function Home() {
const router = useRouter();
const [loading, setLoading] = useState(true);
useEffect(() => {
const token = localStorage.getItem('accessToken');
if (token) {
router.push('/dashboard');
} else {
router.push('/login');
}
setLoading(false);
}, [router]);
if (loading) {
return (
<div className="container" style={{ textAlign: 'center', marginTop: '4rem' }}>
<p>Loading...</p>
</div>
);
}
return null;
}