 (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]

(defn discussion-elements [data]
  (if-not (empty? (:discussion @lib/app-state))
    (dom/div nil
             (bubbles-view)
             (items-view data)
             (control-elements))
    (init-view)))


                          " "
                          (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
  "Show discussion items."
  [data]
  (reify om/IRender
    (render [_]
      (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."
