mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-30 13:28:13 +00:00
refactor: modularize profile setup components and update profile completion logic commit
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
import { Navigate, Outlet } from 'react-router-dom';
|
||||
import { Navigate } from 'react-router-dom';
|
||||
import type { ReactNode } from 'react';
|
||||
import { authStorage } from '@ema-platform/auth';
|
||||
|
||||
export function ProfileGuard() {
|
||||
interface ProfileGuardProps {
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
export function ProfileGuard({ children }: ProfileGuardProps) {
|
||||
const profileId = authStorage.getProfileId();
|
||||
|
||||
if (!profileId) {
|
||||
return <Navigate to="/profile-setup" replace />;
|
||||
}
|
||||
|
||||
return <Outlet />;
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user