 ;(def data (atom {}))
 (def counter (atom 0))
 
+(defn prepare-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)))
+
 (defn statement-handler
   "Called when received a response in the search."
   [response]

      (lib/error-msg! error)
      (do
        (lib/no-error!)
        (lib/update-state-item! :discussion :search (fn [_] res))))))

(defn statement
  "Find related statements to given keywords."

(defn item-view [data owner]
  (reify om/IRender
    (render [_]
      (let [bubble-class nil]
        (dom/li #js {:className bubble-class}
                (dom/div #js {:className "avatar"})
                (dom/p #js {:className "messages"}
                       (vlib/safe-html "foo"))))
      #_(dom/div #js {:id (str (lib/prefix-name "search-item-") (swap! counter inc))}
                 (dom/div nil data)
                 (println data)))))

(defn view []
  (reify om/IRender
