refactor: modularize profile setup components and update profile completion logic commit

This commit is contained in:
mengstabketemaw
2026-06-26 16:12:25 +03:00
parent 08ade42157
commit ac8df4cdff
6 changed files with 624 additions and 310 deletions

View File

@@ -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}</>;
}