 
 ;; ---- Headline --------------------------------------------------------------
 
+(defn collapsed-sign [collapsed]
+  (d/span {:class (str "fa fa-" (if collapsed "chevron-right" "chevron-down"))
+           :style {:margin-right "5px"}}))
+
 (defn remove-query-msg [idx]
   {:form-rel :lens/remove-query
    :params {:idx idx}

                                         (map-indexed (fn [i q] (assoc q :idx i)))
                                         (vec))))})

(defn query-remove-button [owner idx]
  (d/span {:class "fa fa-minus-circle"
           :role "button"
           :style {:margin-left "10px"}
           :on-click (h (bus/publish! owner ::tx (remove-query-msg idx)))}))

(defcomponent headline [headline owner {:keys [idx collapsed]}]
  (render-state [_ {:keys [hover]}]

      (d/div {:class "col-md-12"
              :on-mouse-enter #(om/set-state! owner :hover true)
              :on-mouse-leave #(om/set-state! owner :hover false)}
        (apply d/h4 {:class "text-uppercase text-muted"}
          (collapsed-sign collapsed)
          headline
          (when hover
            [(remove-query-button owner idx)
             (duplicate-query-button owner idx)]))))))

;; ---- Query Grid ------------------------------------------------------------

