                 :on-click (if (empty? @queue)
                             #(dispatch [:play-track id])
                             #(dispatch [:enqueue-track id]))}
-          [:i
-           {:on-click #(dispatch [:play-track id])
-            :class icons}
-           "play_arrow"]
-          [:i
-           {:on-click #(dispatch [:enqueue-track id])
-            :class icons}
-           "queue_music"]
+          (icon #(dispatch [:play-track id]) "play_arrow")
+          (icon #(dispatch [:enqueue-track id]) "queue_music")
           (p/display track)])])))
 
 (defn composer-list

              :let [id (p/id track)]]
         [:div {:key id}
          (when-not (= id (p/id @current-track))
            [:i {:on-click #(dispatch [:play-track id]) :class icons} "play_arrow"])
          [:i
           {:on-click #(dispatch [:dequeue-track id])
            :class icons}
           "clear"]
          (p/display track)])])))

(defn player-controls

  (:require-macros [western-music.util :refer [for']]))

(def ^:const icons "material-icons")

(defn icon
  ([on-click type] (icon {} on-click type))
  ([options on-click type]
   (let [class (if (:class options)
                 (str icons " " (:class options))
                 icons)]
     [:i (assoc options
                :on-click on-click
                :class class)
      type])))

(defn composition-list
  []
