'use client' import { BookOpen, Clock, Users } from 'lucide-react' import { LessonSession } from '@/lib/companion/types' import { VisualPieTimer } from './VisualPieTimer' import { QuickActionsBar } from './QuickActionsBar' import { PhaseTimelineDetailed } from './PhaseTimeline' import { PHASE_COLORS, PHASE_DISPLAY_NAMES, formatTime, getTimerColorStatus, } from '@/lib/companion/constants' interface LessonActiveViewProps { session: LessonSession onPauseToggle: () => void onExtendTime: (minutes: number) => void onSkipPhase: () => void onEndLesson: () => void } export function LessonActiveView({ session, onPauseToggle, onExtendTime, onSkipPhase, onEndLesson, }: LessonActiveViewProps) { const currentPhase = session.phases[session.currentPhaseIndex] const phaseId = currentPhase?.phase || 'einstieg' const phaseColor = PHASE_COLORS[phaseId].hex const phaseName = PHASE_DISPLAY_NAMES[phaseId] // Calculate timer values const phaseDurationSeconds = (currentPhase?.duration || 0) * 60 const elapsedInPhase = currentPhase?.actualTime || 0 const remainingSeconds = phaseDurationSeconds - elapsedInPhase const progress = Math.min(elapsedInPhase / phaseDurationSeconds, 1) const isOvertime = remainingSeconds < 0 const colorStatus = getTimerColorStatus(remainingSeconds, isOvertime) const isLastPhase = session.currentPhaseIndex === session.phases.length - 1 // Calculate total elapsed const totalElapsedMinutes = Math.floor(session.elapsedTime / 60) return (
{/* Header with Session Info */}
{session.className} | {session.subject}

{session.topic || phaseName}

Gesamtzeit
{formatTime(session.elapsedTime)}
{/* Main Timer Section */}
{/* Visual Pie Timer */} {/* Quick Actions */}
{/* Phase Timeline */} ({ id: p.phase, shortName: p.phase[0].toUpperCase(), displayName: PHASE_DISPLAY_NAMES[p.phase], duration: p.duration, status: p.status === 'active' ? 'active' : p.status === 'completed' ? 'completed' : 'planned', actualTime: p.actualTime, color: PHASE_COLORS[p.phase].hex, }))} currentPhaseIndex={session.currentPhaseIndex} onPhaseClick={(index) => { // Optional: Allow clicking to navigate to a phase }} /> {/* Lesson Stats */}
{totalElapsedMinutes}
Minuten vergangen
{session.currentPhaseIndex + 1}/{session.phases.length}
Phase
{session.totalPlannedDuration - totalElapsedMinutes}
Minuten verbleibend
{/* Keyboard Shortcuts Hint */}
Leertaste Pause E +5 Min N Weiter
) }