mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-09-07 08:25:45 +00:00
17 lines
560 B
TypeScript
17 lines
560 B
TypeScript
import { Navigate } from 'react-router-dom';
|
|
import { LandingPage } from '@ema-platform/ui';
|
|
import { useAuthToken } from '@ema-platform/auth';
|
|
|
|
/**
|
|
* Public `/`. Signed-in visitors skip the landing page entirely and go
|
|
* straight to the dashboard — the landing page is a front door for people
|
|
* who aren't in yet, not a screen for people who already are.
|
|
*/
|
|
export function LandingRoute() {
|
|
const token = useAuthToken();
|
|
|
|
if (token) return <Navigate to="/dashboard" replace />;
|
|
|
|
return <LandingPage primaryHref="/login" signupHref="/signup" />;
|
|
}
|