import Cookies from 'js-cookie';
import { LandingPage } from '@ema-platform/ui';
import { authStorage } from '@ema-platform/auth';

/**
 * Public `/` — mounts the shared landing page. Backoffice has no /signup
 * (enableSignup: false) and no /verify route, so those props are omitted.
 */
export function LandingRoute() {
  const token = authStorage.getToken() ?? Cookies.get('auth-token');

  return <LandingPage primaryHref={token ? '/dashboard' : '/login'} />;
}
