From fd8b7f6d36baa71473dc1ad26befdee0c8cfe6fa Mon Sep 17 00:00:00 2001 From: Sidney Gomes Date: Sat, 25 Jul 2026 11:42:40 -0300 Subject: [PATCH] =?UTF-8?q?Adicionado=20bot=C3=B5es=20de=20navega=C3=A7?= =?UTF-8?q?=C3=A3o=20Aula=20Anterior=20e=20Pr=C3=B3xima=20Aula?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CourseView.tsx | 40 ++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/components/CourseView.tsx b/src/components/CourseView.tsx index 30e17ea..ddab735 100644 --- a/src/components/CourseView.tsx +++ b/src/components/CourseView.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { ArrowLeft, BookOpen, ChevronRight, FileText, CheckCircle2, Circle, MessageSquare, AlertCircle, Award, Download } from 'lucide-react'; +import { ArrowLeft, BookOpen, ChevronRight, ChevronLeft, FileText, CheckCircle2, Circle, MessageSquare, AlertCircle, Award, Download } from 'lucide-react'; import VideoPlayer from './VideoPlayer'; import CourseActivity from './CourseActivity'; @@ -297,6 +297,13 @@ export default function CourseView({ courseId, token, onBack, initialLessonId }: ); } + // Derived state for prev/next lesson + const allLessons = modules.flatMap(m => m.lessons); + const activeLessonIndex = activeLesson ? allLessons.findIndex(l => l.id === activeLesson.id) : -1; + const prevLesson = activeLessonIndex > 0 ? allLessons[activeLessonIndex - 1] : null; + const nextLesson = activeLessonIndex >= 0 && activeLessonIndex < allLessons.length - 1 ? allLessons[activeLessonIndex + 1] : null; + const isCurrentLessonCompleted = activeLesson?.progress?.completed; + return (
{/* Back Header */} @@ -332,6 +339,37 @@ export default function CourseView({ courseId, token, onBack, initialLessonId }: onReact={handleReact} /> + {/* Navigation Buttons */} +
+ + + +
+ {/* Lesson Description Content */} {activeLesson.content && (