Pending course, rest ready for launch

This commit is contained in:
Marcelo
2026-03-15 13:52:11 +00:00
parent be4ca2ed78
commit 62b3cfe467
77 changed files with 6450 additions and 868 deletions

View File

@@ -3,6 +3,7 @@ import { requireTeacher } from "@/lib/auth/requireTeacher";
import { redirect, notFound } from "next/navigation";
import Link from "next/link";
import { LessonEditorForm } from "./LessonEditorForm";
import { parseLessonDescriptionMeta } from "@/lib/courses/lessonContent";
function getText(value: unknown): string {
if (!value) return "";
@@ -42,6 +43,8 @@ export default async function LessonPage({ params }: PageProps) {
if (!lesson) notFound();
if (lesson.module.course.authorId !== user.id) redirect("/teacher");
const lessonMeta = parseLessonDescriptionMeta(lesson.description);
return (
<div className="max-w-4xl mx-auto p-6">
{/* Breadcrumbs */}
@@ -64,10 +67,13 @@ export default async function LessonPage({ params }: PageProps) {
lesson={{
...lesson,
title: getText(lesson.title),
description: getText(lesson.description),
description: lessonMeta.text,
contentType: lessonMeta.contentType,
materialUrl: lessonMeta.materialUrl,
estimatedDurationMinutes: Math.max(0, Math.ceil((lesson.estimatedDuration ?? 0) / 60)),
}}
courseSlug={slug}
/>
</div>
);
}
}