From 43f3ce2c6c1ec6569e77d94378ed7a79c528ba83 Mon Sep 17 00:00:00 2001 From: Hermann_Kitio Date: Tue, 21 Apr 2026 02:36:28 +0300 Subject: [PATCH] =?UTF-8?q?fix(simulations):=20TaskSelector=20EE=20?= =?UTF-8?q?=E2=80=94=20retirer=20cartes=20EO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simulations/components/TaskSelector.tsx | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/src/features/simulations/components/TaskSelector.tsx b/src/features/simulations/components/TaskSelector.tsx index 1ddce14..24c8adb 100644 --- a/src/features/simulations/components/TaskSelector.tsx +++ b/src/features/simulations/components/TaskSelector.tsx @@ -1,16 +1,14 @@ /** - * Sélecteur de tâche pour lancer une simulation. + * Sélecteur de tâche pour lancer une simulation Expression Écrite. * - * Affiche les 6 tâches TCF : - * - EE T1/T2/T3 → sélectionnables si quota OK - * - EO T1/T3 → verrouillées (audio — Sprint 4) - * - EO T2 Live → verrouillée (Exclusivité Premium — Sprint 6) + * Affiche les 3 tâches EE : T1, T2, T3 (sélectionnables si quota OK). + * Les tâches Expression Orale seront sur /simulation/eo (Sprint EO). * * Règle D : le quota est vérifié via canSimulate(), jamais if (plan === 'free'). * Règle H : aucune logique métier — uniquement appel de canSimulate() et affichage. */ -import { Lock, Loader2 } from 'lucide-react' +import { Loader2 } from 'lucide-react' import { canSimulate } from '@/entities/user/lib' import { cn } from '@/shared/lib/utils' import { Card } from '@/shared/ui/Card' @@ -26,20 +24,15 @@ interface Props { } interface TaskCard { - tache: Tache | null // null = EO T2 Live (hors Tache type) + tache: Tache label: string sublabel: string - sprintLocked?: boolean // audio ou premium non encore implémenté - lockLabel?: string } const TASK_CARDS: readonly TaskCard[] = [ { tache: 'EE_T1', label: 'Expression Écrite', sublabel: 'Tâche 1' }, { tache: 'EE_T2', label: 'Expression Écrite', sublabel: 'Tâche 2' }, { tache: 'EE_T3', label: 'Expression Écrite', sublabel: 'Tâche 3' }, - { tache: 'EO_T1', label: 'Expression Orale', sublabel: 'Tâche 1', sprintLocked: true, lockLabel: 'Bientôt disponible' }, - { tache: 'EO_T3', label: 'Expression Orale', sublabel: 'Tâche 3', sprintLocked: true, lockLabel: 'Bientôt disponible' }, - { tache: null, label: 'Expression Orale', sublabel: 'Tâche 2 — Live', sprintLocked: true, lockLabel: 'Exclusivité Premium' }, ] export function TaskSelector({ plan, simulationsUsed, isLoading, onSelect }: Props) { @@ -70,24 +63,19 @@ export function TaskSelector({ plan, simulationsUsed, isLoading, onSelect }: Pro
{TASK_CARDS.map((card) => { - const locked = card.sprintLocked || quotaBlocked - const abbrev = (card.tache?.split('_')[0]) ?? 'EO' + const abbrev = card.tache.split('_')[0] - if (locked || card.tache === null) { + if (quotaBlocked) { return ( - ) } @@ -98,7 +86,7 @@ export function TaskSelector({ plan, simulationsUsed, isLoading, onSelect }: Pro variant="interactive" className={cn('relative flex flex-col p-4', isLoading && 'cursor-wait')} onClick={() => { - if (!isLoading) onSelect({ tache: card.tache as Tache, mode: 'entrainement' }) + if (!isLoading) onSelect({ tache: card.tache, mode: 'entrainement' }) }} >