This commit is contained in:
eric
2026-03-23 22:59:42 -05:00
parent 614f001986
commit 0528b1853a
8 changed files with 54 additions and 13 deletions

View File

@@ -4,7 +4,7 @@ import { useState, useEffect } from "react";
import { Link } from "@/i18n/navigation";
import { Section } from "./Section";
import { CURRICULUM_CONFIG } from "@/config/course";
import { canWatchLesson } from "@/app/lib/course-payment";
import { canWatchLesson, isFreeTrial } from "@/app/lib/course-payment";
import { useAuthAndVip } from "@/app/lib/useAuthAndVip";
import { isBookmarked, toggleBookmark, getBookmarks, getCompletedLessons } from "@/app/lib/learning";
@@ -99,7 +99,6 @@ export function CurriculumSection() {
{isOpen && (
<ul className="border-t border-[var(--border)]">
{c.lessons.map((l) => {
const free = l.moduleIndex === 0 && l.lessonIndex < 2;
const unlocked = canWatchLesson(l.moduleIndex, l.lessonIndex, vip);
const key = `${l.moduleIndex}-${l.lessonIndex}`;
const bookmarked = isBookmarked(l.moduleIndex, l.lessonIndex);
@@ -126,7 +125,7 @@ export function CurriculumSection() {
<span className={unlocked ? "text-[var(--foreground)]" : "text-[var(--muted-foreground)]"}>
{l.name}
</span>
{free && (
{isFreeTrial(l.moduleIndex, l.lessonIndex) && (
<span className="shrink-0 rounded bg-[var(--accent)]/20 px-1.5 py-0.5 text-xs text-[var(--accent)]">
</span>