'use client'; /** * PBL v2 — Right-column tabbed panel (SCENARIO ONLY, post-prep). * * Wraps the existing submission panel with a second tab — the scenario * briefing — once the learner has entered the scenario. The workspace only * mounts this for scenario projects whose prep stage is complete; ordinary * projects (and scenario projects still in prep) render the bare submission * panel exactly as before, so this has zero footprint there. * * Both panels stay MOUNTED and are toggled with CSS visibility (not unmounted). * This is deliberate: the submission panel owns an in-flight post-submit * evaluation stream and a draft modal; unmounting it on a tab switch would * abort the evaluation and drop local state. Hiding it leaves all of that * running untouched. */ import { useState } from 'react'; import { BookOpen, Upload } from 'lucide-react'; import type { PBLProjectV2 } from '@/lib/pbl/v2/types'; import { cn } from '@/lib/utils/cn'; import { useI18n } from '@/lib/hooks/use-i18n'; import { PBLV2SubmissionPanel, type SubmissionEvaluationStatus } from './submission'; import { ScenarioBriefing } from './scene-stage/scenario-briefing'; type RightPanelTab = 'submission' | 'briefing'; interface Props { readonly project: PBLProjectV2; readonly onProjectChange: (next: PBLProjectV2) => void; readonly onEvaluationStatusChange: (status: SubmissionEvaluationStatus | null) => void; readonly onInstructorStreamingChange: (active: boolean) => void; readonly instructorStreaming: boolean; } export function PBLV2RightPanelTabs({ project, onProjectChange, onEvaluationStatusChange, onInstructorStreamingChange, instructorStreaming, }: Props) { const { t } = useI18n(); // Default to the submission tab so the panel behaves exactly as before until // the learner actively reaches for the briefing. const [tab, setTab] = useState('submission'); return (
setTab('submission')} icon={} label={t('pbl.v2.briefing.submissionTab')} /> setTab('briefing')} icon={} label={t('pbl.v2.briefing.briefingTab')} />
); } function TabButton({ active, onClick, icon, label, }: { readonly active: boolean; readonly onClick: () => void; readonly icon: React.ReactNode; readonly label: string; }) { return ( ); }