refactor(simulations): supprimer SujetSelector + selectSujet orphelins (FTD-22)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6bfdf15db9
commit
4712a3a16e
4 changed files with 40 additions and 170 deletions
|
|
@ -11,19 +11,11 @@
|
|||
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useSimulationFlow } from '../state/SimulationFlowProvider'
|
||||
import type { SujetData } from '@/entities/production/types'
|
||||
|
||||
export function useSimulation() {
|
||||
const navigate = useNavigate()
|
||||
const flow = useSimulationFlow()
|
||||
|
||||
/** Sélectionne un sujet puis passe à la saisie (utilisé depuis /sujets). */
|
||||
function selectSujet(sujet: SujetData): void {
|
||||
flow.changeSubject(sujet)
|
||||
flow.setStep('task-selected')
|
||||
navigate('/simulation/ee')
|
||||
}
|
||||
|
||||
/** Retour à /sujets depuis SimulationForm (bouton "Changer de sujet"). */
|
||||
function goToSubjectPicker(): void {
|
||||
flow.setStep('choosing-subject')
|
||||
|
|
@ -42,7 +34,6 @@ export function useSimulation() {
|
|||
selectTask: flow.selectTask,
|
||||
submitText: flow.submitText,
|
||||
changeSubject: flow.changeSubject,
|
||||
selectSujet,
|
||||
goToSubjectPicker,
|
||||
reset: flow.reset,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue