   (map #(assoc % "status" "Complete") workspaces))
 
 (react/defc Page
-  {:render
+  {:get-initial-state
+   (fn [] {:active-filter :all})
+   :render
    (fn [{:keys [state refs]}]
      [:div {}
       (render-overlay state refs)

(defn- filter-workspaces [f workspaces]
  (case f
    :all workspaces
    :complete  (filter (fn [ws] (= "Complete"  (ws "status"))) workspaces)
    :running   (filter (fn [ws] (= "Running"   (ws "status"))) workspaces)
    :exception (filter (fn [ws] (= "Exception" (ws "status"))) workspaces)))

(react/defc WorkspaceList

             build-text (fn [name f]
                          (str name " (" (count (filter-workspaces f (:workspaces @state))) ")"))]
         [:div {:style {:display "inline-block" :marginLeft "-1em"}}
          [Button {:text (build-text "All" :all) :state state :filter :all}]
          [Button {:text (build-text "Complete" :complete) :state state :filter :complete}]
          [Button {:text (build-text "Running" :running) :state state :filter :running}]
          [Button {:text (build-text "Exception" :exception) :state state :filter :exception}]
          [:div {:style {:clear "both"}}]]))}))

