// LessonUpsellModal — shown when a learner clicks a locked standalone Lesson. // Mirrors UnitUpsellModal.jsx: unlocks via any course reachable through its // attached Units (aggregated across all of them, since a Lesson can sit in // more than one), plus a generic "View Plans" fallback. // Shared by LessonsList and Dashboard. import { useNavigate } from "react-router-dom"; import { LockIcon, Check } from "lucide-react"; import ResponsiveModal from "@/components/generic/ResponsiveModal"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { resolveTierBadge, cheapestTierSlug } from "@/utils/tierBadge.util"; export default function LessonUpsellModal({ open, onOpenChange, lesson, tierMap = {} }) { const navigate = useNavigate(); const courses = lesson?.courses ?? []; const slug = cheapestTierSlug([lesson?.subscription, ...courses.map((c) => c.subscription)], tierMap); const { rank, label, cls, panel } = resolveTierBadge(slug, tierMap); return ( } >
{rank > 0 && (
{label}
  • Access to {label} content
  • Certificates & achievements

Upgrade to a {label} plan to unlock this lesson.

)}
); }