import { Navigate } from 'react-router-dom' import { useAuthStore } from '../stores/auth' export default function RouteGuard({ children }: { children: React.ReactNode }) { const { state } = useAuthStore() if (state === 'loading') { return (
) } if (state === 'unauthenticated' || state === 'error') { return } return <>{children} }