feat: frontend skeleton done

This commit is contained in:
simonkoson
2026-05-15 09:46:42 +08:00
parent 2bee0ce8c8
commit d29b1bb394
36 changed files with 5008 additions and 0 deletions
@@ -0,0 +1,21 @@
import { useEffect } from 'react'
import { Navigate, Outlet } from 'react-router-dom'
import useAuthStore from '../../stores/authStore'
function AuthGuard() {
const { user, fetchMe } = useAuthStore()
useEffect(() => {
if (user === null) {
fetchMe()
}
}, [user, fetchMe])
if (user === null) {
return null
}
return user ? <Outlet /> : <Navigate to="/login" replace />
}
export default AuthGuard