       [:h2 "Library"]
       [:form#library-search.pure-form
         [:input.pure-input-3-4 {:type "text"
-                           :id "query"
-                           :placeholder "Search trough the library..."
-                           :value (@app-state :query)
-                           :on-change on-query-change}]
+                               :id "query"
+                               :placeholder "Search trough the library..."
+                               :value (@app-state :query)
+                               :on-change on-query-change}]
         [:span.pure-input-1-4 (str "Tracks: " (count tracks))]]
       [:table.pure-table.pure-table-striped
         [:thead


(defn track-tr [track action-button]
  [:tr.track
   [:td
    (when action-button
      [action-button track])]
   [:td (track :title)] [:td (track :artist)] [:td (track :album)]])

;; -------------------------
;; Playlist

(defn playlist-section []
  [:section#playlist
   [:h2 "Playlist"]
   (if-let [tracks (not-empty (@app-state :playlist))]
     [:table.pure-table.pure-table-striped
      [:thead
       [:tr [:th] [:th  "Title"] [:th "Artist"] [:th "Album"]]]
      [:tbody (for [track tracks]
                ^{:key track} [track-tr track playlist-remove-button])]]
     "The playlist is empty.")])

;; -------------------------
;; Search

  (let [form-ref (r/atom nil)]
    (fn []
      [:section#upload
        [:h2 "Upload"]

        [:form.pure-form
          {:ref #(reset! form-ref %)}
          [:input.pure-input-3-4 {:type "file" :name "track"}]
          [:input.pure-button.pure-button-primary.pure-input-1-4
            {:type "button" :value "Upload"
            :on-click #(when-let [form @form-ref] (req/upload! form))}]
          [progress-bar]]

        [:p (@app-state :upload-status)]])))

;; -------------------------
;; Tracks
