ENGLISH·COURSE API
    Preparing search index...
    • Decides what the course route shows: the course page to a learner who has not joined the course, the progress board to one who has (capabilities course-detail-page, cinema-course-overview).

      Parameters

      Returns
          | string
          | number
          | bigint
          | boolean
          | Iterable<ReactNode, any, any>
          | Promise<AwaitedReactNode>
          | Element
          | null
          | undefined

      Enrollments live in the learner store, which is seeded on the client, so until then the switch renders a pending shape that carries only the course title. The decision is taken once, from the enrollments the store was seeded with: a learner who enrolls from the course page keeps seeing it, now in its enrolled state, rather than having the page swapped for the board under them. Their next visit opens the board.

      Both candidates are rendered by the server and passed in, so the board stays the same Server Component tree it was before this switch existed.

      <CoursePageSwitch
      courseSlug={course.slug}
      title={course.title}
      detail={<CourseDetailView view={view} />}
      board={<CourseOverview {...view} />}
      />