'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 '../companion-mode/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 (