score:0

const unauthenticatedRoutes = (
  <Routes>
    <Route path="/" element={<MarketingWrapper />}>
      <Route index element={<MarketingHome />
      <Route path="*" element={<SignUpSignIn />} />
    </Route>
  </Routes>
)

const authenticatedRoutes = (
  <Routes>
    <Route path="/" element={<DashboardWrapper />}>
      <Route index element={<Dashboard />
      <Route path="*" element={<NoMatch />} />
      <Route path="enter" element={<SignUpSignIn />} />
      <Route path='signout' element={<SignOut signOut={signOut} />} />
      <Route path="jobs" element={<JobsList jobId={jobId!} />}>
        <Route path=":jobId" element={<JobPage />} />
        <Route index element={<JobNew jobId={jobId!} />} />
      </Route>
    </Route>
  </Routes>
)

return (
  isAuthenticated ? authenticatedRoutes : unauthenticatedRoutes
)

Related Query

More Query from same tag