   (:require-macros [sablono.core :refer (html)])
   (:import [goog.ui IdGenerator]))
 
+; (defn description-form [{:keys [issue issue-id]} owner]
+;   (reify
+;     om/IDisplayName (display-name [_] "Description form")
+;     om/IInitState (init-state [_] {:issue-description nil
+;                                    :describing? false})
+;     om/IRenderState
+;     (render-state [_ {:keys [issue-description]}]
+;       (let [{:keys [issue-db cust cast!]} (om/get-shared owner)]
+;         (html
+;           [:div.original-comment
+;           (if (:issue/description issue)
+
+;             [:div.issue-comment
+;              [:p.make (:issue/description issue)]
+;              [:p.issue-foot.make
+;               [:span (common/icon :user) " "]
+;               [:a {:role "button"}
+;                (:issue/author issue)]
+;               [:span " on "]
+;               [:a {:role "button"}
+;                (datetime/month-day (:issue/created-at issue))]
+;               [:span " — "]
+;               [:a {:role "button"
+;                    :on-click #(do
+;                                 (if (om/get-state owner :replying?)
+;                                   (om/set-state! owner :replying? false)
+;                                   (om/set-state! owner :replying? true)))}
+;                (if (om/get-state owner :describing?) "Cancel" "Reply")]]]
+
+;             [:div.content.make
+;              [:form.adaptive {:on-submit #(do (utils/stop-event %)
+;                                             (when issue-description
+;                                               (d/transact! issue-db [{:db/id (:db/id issue)
+;                                                                       :issue/description issue-description}]))
+;                                             (om/set-state! owner :issue-description nil)
+;                                             (om/set-state! owner :replying? false))}
+;               [:textarea {:value (or issue-description (:issue/description issue ""))
+;                           :required "true"
+;                           :onChange #(om/set-state! owner :issue-description (.. % -target -value))}]
+;               [:label {:data-label "label here"
+;                        :data-placeholder "How can we improve Precursor?"}]
+;               [:input {:type "submit"
+;                        :value "Submit idea."}]]])
+
+;           (om/build comment-form {:issue-id issue-id})
+
+;           ])))))
+
 (defn issue-form [_ owner]
   (reify
     om/IDisplayName (display-name [_] "Issue form")

           [:input {:type "submit"
                    :value "Submit idea."}]]])))))

(defn comment-form [{:keys [issue-id parent-id]} owner {:keys [issue-db]}]
  (reify
    om/IDisplayName (display-name [_] "Comment form")
    om/IInitState (init-state [_] {:comment-body ""})

           ; [:input {:value (or description (:issue/description issue ""))
           ;          :on-change #(om/set-state! owner :description (.. % -target -value))}]

           (om/build description-form {:issue issue
                                       :issue-id issue-id})

           ; (om/build comment-form {:issue-id issue-id})

           ; [:div.comment-author
           ;  [:span.comment-avatar (common/icon :user)]
           ;  [:span.comment-name (str " " (:issue/author issue))]
