ENGLISH·COURSE API
    Preparing search index...
    • How many of a module's lessons the learner has finished.

      Parameters

      • lessonRuntimes: readonly LessonRuntime[]

        The module's lessons, each with its runtime

      Returns ModuleWatchProgress

      The completed count and the module's lesson count; both 0 for a module holding no lessons, which the caller renders as no meter

      Counts with countsAsComplete, the same rule useLessonWatchState applies to a single lesson, so a module's meter and its lessons' rows can never disagree.

      It reads the two stores once and applies the rule per lesson rather than calling useLessonWatchState in a loop: the number of lessons varies from module to module, and a hook call per lesson would break the rules of hooks the moment a course is reordered.

      The caller is expected to pass ModuleSummary.lessonRuntimes — every lesson the module holds, not the bounded preview the gallery renders.

      Browser-side only — do NOT call from a Server Component.

      const { completedCount, lessonCount } = useModuleWatchProgress(summary.lessonRuntimes);
      if (completedCount === 0) return null;