 
 (defmethod r/route->component ::r/topic [_] TopicPage)
 
+(om/defui ^:once LessonTopicMenuItem
+  static om/IQuery
+  (query [_] [:lesson/title :url/slug])
+
+  static om/Ident
+  (ident [_ props] (u/model-ident props))
+
+  Object
+  (render [this]
+    (let [{:keys [url/slug lesson/title]} (om/props this)]
+      (dom/div nil
+        (button {::r/handler ::r/lesson ::r/params {::r/slug slug}} title)))))
+
+(def lesson-topic-menu-item (om/factory LessonTopicMenuItem {:key-fn :db/id}))
+
+(om/defui ^:once LessonTopicMenu
+  static om/IQuery
+  (query [_] [:topic/title
+              {:topic/course (om/get-query CourseTopicsMenu)}
+              {:topic/lessons (om/get-query LessonTopicMenuItem)}])
+
+  static om/Ident
+  (ident [_ props] (u/model-ident props))
+
+  Object
+  (render [this]
+    (let [{:keys [topic/course topic/lessons topic/title]} (om/props this)]
+      (dom/div nil
+        (course-topics-menu course)
+        title
+        (dom/div nil
+          (map lesson-topic-menu-item lessons))))))
+
+(def lesson-topic-menu (om/factory LessonTopicMenu))
+
 (om/defui ^:once YoutubeVideo
   Object
   (render [this]

(om/defui ^:once LessonVideo
  static om/IQuery
  (query [_] [:lesson/type :lesson/description :youtube/id
              {:lesson/topic [{:topic/course (om/get-query CourseTopicsMenu)}]}])

  Object
  (render [this]
    (let [{:keys [lesson/description] :as props} (om/props this)]
      (dom/div nil
        (course-topics-menu (get-in props [:lesson/topic :topic/course]))
        (dom/div #js {:className "vendor"} (youtube-video props))
        (dom/div nil description)))))


(om/defui ^:once LessonPlaylist
  static om/IQuery
  (query [_] [:lesson/type :lesson/description
              {:lesson/playlist-items (om/get-query LessonPlaylistItem)}
              {:lesson/topic (om/get-query LessonTopicMenu)}])

  Object
  (render [this]
    (let [{:keys [lesson/topic]} (om/props this)]
      (dom/div nil
        (lesson-topic-menu topic)
        "Playlist"))))

(def lesson-playlist (om/factory LessonPlaylist))

(om/defui ^:once LessonExercise
  static om/IQuery
  (query [_] [:lesson/type :lesson/title
              {:lesson/topic (om/get-query LessonTopicMenu)}])

  Object
  (render [this]
    (let [{:keys [lesson/topic]} (om/props this)]
      (dom/div nil
        (lesson-topic-menu topic)
        "Exercise"))))

(def lesson-exercise (om/factory LessonExercise))

