             [discuss.utils.common :as lib]
             [discuss.utils.views :as vlib]))
 
-;(def data (atom {}))
-(def counter (atom 0))
-
-(defn prepare-search-results
+(defn get-search-results
   "Extract values and create a list of maps."
   []
-  (let [vals (get-in @lib/app-state [:discussion :search :values])
-        vals-dict (for [[k v] vals] {k v})]
-    (vec vals-dict)))
+  (get-in @lib/app-state [:discussion :search :values]))
 
 (defn statement-handler
   "Called when received a response in the search."

                                  (vlib/fa-icon "fa-search fa-fw"))
                        (dom/input #js {:className   "form-control"
                                        :onChange    #(statement (.. % -target -value))
                                        :placeholder "Find Statement"}))
               ;(println (prepare-search-results))
               #_(apply dom/ol #js {:className "foobar"}
                        (om/build-all item-view (lib/get-bubbles)))
               #_(apply dom/div nil
                        (om/build-all item-view vals-dict
                                      ))
               ))))

(defn results-view []
  (reify om/IRender
    (render [_]
      (dom/div nil
               (apply dom/ol nil
                      (om/build-all item-view (prepare-search-results)))))))
(defn item-view [data owner]
  (reify om/IRender
    (render [_]
      (dom/div #js {:className "bs-callout bs-callout-info"}
               (vlib/safe-html (:text data))
               (dom/span #js {:className "badge pull-right"}
                         (lib/str->int (:distance data)))))))

(defn form-view []
  (reify om/IRender
