feat(simulations): router /sujets + SimulationFlowProvider wiring + useSimulation refacto
This commit is contained in:
parent
782439b309
commit
a6f95c2093
4 changed files with 87 additions and 116 deletions
|
|
@ -6,7 +6,9 @@ import { RegisterPage } from '@/features/auth/pages/RegisterPage'
|
|||
import { ProtectedRoute } from '@/features/auth/components/ProtectedRoute'
|
||||
import { DashboardPage } from '@/features/dashboard/pages/DashboardPage'
|
||||
import { SimulationPage } from '@/features/simulations/pages/SimulationPage'
|
||||
import { SujetsPage } from '@/features/simulations/pages/SujetsPage'
|
||||
import { RapportPage } from '@/features/simulations/pages/RapportPage'
|
||||
import { SimulationFlowProvider } from '@/features/simulations/state/SimulationFlowProvider'
|
||||
import { AppLayout } from './AppLayout'
|
||||
|
||||
const DesignSystemPage = import.meta.env.DEV
|
||||
|
|
@ -32,6 +34,14 @@ function PrivateLayout() {
|
|||
)
|
||||
}
|
||||
|
||||
function SimulationFlowLayout() {
|
||||
return (
|
||||
<SimulationFlowProvider>
|
||||
<Outlet />
|
||||
</SimulationFlowProvider>
|
||||
)
|
||||
}
|
||||
|
||||
export function AppRouter() {
|
||||
return (
|
||||
<Routes>
|
||||
|
|
@ -44,9 +54,12 @@ export function AppRouter() {
|
|||
<Route path="/" element={<Navigate to="/dashboard" replace />} />
|
||||
<Route path="/dashboard" element={<DashboardPage />} />
|
||||
|
||||
{/* Simulation */}
|
||||
{/* Simulation — /simulation/ee et /sujets partagent le SimulationFlowProvider. */}
|
||||
<Route path="/simulation" element={<Navigate to="/simulation/ee" replace />} />
|
||||
<Route path="/simulation/ee" element={<SimulationPage />} />
|
||||
<Route element={<SimulationFlowLayout />}>
|
||||
<Route path="/simulation/ee" element={<SimulationPage />} />
|
||||
<Route path="/sujets" element={<SujetsPage />} />
|
||||
</Route>
|
||||
<Route path="/simulation/eo" element={<ComingSoon />} />
|
||||
|
||||
{/* Rapport */}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue