A previous `git pull --rebase origin main` dropped 177 local commits,
losing 3400+ files across admin-v2, backend, studio-v2, website,
klausur-service, and many other services. The partial restore attempt
(660295e2) only recovered some files.
This commit restores all missing files from pre-rebase ref 98933f5e
while preserving post-rebase additions (night-scheduler, night-mode UI,
NightModeWidget dashboard integration).
Restored features include:
- AI Module Sidebar (FAB), OCR Labeling, OCR Compare
- GPU Dashboard, RAG Pipeline, Magic Help
- Klausur-Korrektur (8 files), Abitur-Archiv (5+ files)
- Companion, Zeugnisse-Crawler, Screen Flow
- Full backend, studio-v2, website, klausur-service
- All compliance SDKs, agent-core, voice-service
- CI/CD configs, documentation, scripts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
81 lines
2.0 KiB
TypeScript
81 lines
2.0 KiB
TypeScript
'use client'
|
|
|
|
import { LessonSession, LessonStatus } from '@/lib/companion/types'
|
|
import { LessonStartForm } from './LessonStartForm'
|
|
import { LessonActiveView } from './LessonActiveView'
|
|
import { LessonEndedView } from './LessonEndedView'
|
|
|
|
interface LessonContainerProps {
|
|
session: LessonSession | null
|
|
onStartLesson: (data: { classId: string; subject: string; topic?: string; templateId?: string }) => void
|
|
onEndLesson: () => void
|
|
onPauseToggle: () => void
|
|
onExtendTime: (minutes: number) => void
|
|
onSkipPhase: () => void
|
|
onSaveReflection: (rating: number, notes: string, nextSteps: string) => void
|
|
onAddHomework: (title: string, dueDate: string) => void
|
|
onRemoveHomework: (id: string) => void
|
|
loading?: boolean
|
|
}
|
|
|
|
export function LessonContainer({
|
|
session,
|
|
onStartLesson,
|
|
onEndLesson,
|
|
onPauseToggle,
|
|
onExtendTime,
|
|
onSkipPhase,
|
|
onSaveReflection,
|
|
onAddHomework,
|
|
onRemoveHomework,
|
|
loading,
|
|
}: LessonContainerProps) {
|
|
// Determine which view to show based on session state
|
|
const getView = (): 'start' | 'active' | 'ended' => {
|
|
if (!session) return 'start'
|
|
|
|
const status = session.status
|
|
if (status === 'completed') return 'ended'
|
|
if (status === 'not_started') return 'start'
|
|
|
|
return 'active'
|
|
}
|
|
|
|
const view = getView()
|
|
|
|
if (view === 'start') {
|
|
return (
|
|
<LessonStartForm
|
|
onStart={onStartLesson}
|
|
loading={loading}
|
|
/>
|
|
)
|
|
}
|
|
|
|
if (view === 'ended' && session) {
|
|
return (
|
|
<LessonEndedView
|
|
session={session}
|
|
onSaveReflection={onSaveReflection}
|
|
onAddHomework={onAddHomework}
|
|
onRemoveHomework={onRemoveHomework}
|
|
onStartNew={() => onEndLesson()} // This will clear the session and show start form
|
|
/>
|
|
)
|
|
}
|
|
|
|
if (session) {
|
|
return (
|
|
<LessonActiveView
|
|
session={session}
|
|
onPauseToggle={onPauseToggle}
|
|
onExtendTime={onExtendTime}
|
|
onSkipPhase={onSkipPhase}
|
|
onEndLesson={onEndLesson}
|
|
/>
|
|
)
|
|
}
|
|
|
|
return null
|
|
}
|