 (ns discuss.views
   (:require [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]
+            [goog.dom :as gdom]
             [clojure.string :as string]
             [discuss.auth :as auth]
             [discuss.clipboard :as clipboard]

                          " "
                          (vlib/safe-html (string/join " <i>and</i> " (map :title (:premises item))))))))) ; get all premises of item and add an "and" between them

(defn items-view [data]
  (dom/div nil
           (apply dom/ul #js {:id (lib/prefix-name "items-main")}
                  (map #(om/build item-view (lib/merge-react-key %)) (:items data)))))

(defn init-view
  "Show button if discussion has not been initialized yet."

                       (vlib/safe-html (:message bubble))))))))

(defn bubbles-view []
  (reify
    om/IDidUpdate
    (did-update [_this _prev-props _prev-state]
      (vlib/scroll-divs-to-bottom "bubbles"))
    om/IRender
    (render [_]
      (apply dom/ol #js {:className (lib/prefix-name "bubbles")}
             (map #(om/build bubble-view (lib/merge-react-key %)) (lib/get-bubbles))))))

(defn item-view [item _owner]
  (reify om/IRender
