'use client' import { Lesson, QuizQuestion } from '@/lib/sdk/academy/types' interface LessonsTabProps { sortedLessons: Lesson[] selectedLesson: Lesson | null onSelectLesson: (lesson: Lesson) => void quizAnswers: Record onQuizAnswer: (answers: Record) => void quizResult: any isSubmittingQuiz: boolean onSubmitQuiz: () => void onResetQuiz: () => void isEditing: boolean editTitle: string editContent: string onEditTitle: (v: string) => void onEditContent: (v: string) => void isSaving: boolean saveMessage: { type: 'success' | 'error'; text: string } | null onStartEdit: () => void onCancelEdit: () => void onSaveLesson: () => void onApproveLesson: () => void } export function LessonsTab({ sortedLessons, selectedLesson, onSelectLesson, quizAnswers, onQuizAnswer, quizResult, isSubmittingQuiz, onSubmitQuiz, onResetQuiz, isEditing, editTitle, editContent, onEditTitle, onEditContent, isSaving, saveMessage, onStartEdit, onCancelEdit, onSaveLesson, onApproveLesson, }: LessonsTabProps) { return (
{/* Lesson Navigation */}

Lektionen

{sortedLessons.map((lesson, i) => ( ))}
{/* Lesson Content */}
{selectedLesson ? (
{isEditing ? ( onEditTitle(e.target.value)} className="text-xl font-semibold text-gray-900 border border-gray-300 rounded-lg px-3 py-1 flex-1 mr-3" /> ) : (

{selectedLesson.title}

)}
{selectedLesson.type === 'quiz' ? 'Quiz' : selectedLesson.type === 'video' ? 'Video' : 'Text'} {selectedLesson.type !== 'quiz' && !isEditing && ( <> )} {isEditing && ( <> )}
{saveMessage && (
{saveMessage.text}
)} {selectedLesson.type === 'video' && selectedLesson.videoUrl && (
)} {isEditing && (selectedLesson.type === 'text' || selectedLesson.type === 'video') && (