 (ns tropology.core
-  (:require [reagent.core :as reagent :refer [atom]]
+  (:require [ajax.core :refer [GET POST PUT]]
+            [reagent.core :as reagent :refer [atom]]
             [clojure.string :refer [lower-case]]
             [goog.object :as gobject]
             [secretary.core :as secretary]

    ))


(defn list-tropes [trope-code]
  (.log js/console trope-code))


(def trope-code-form

                                          [:input {:type     "button"
                                                   :value    "List tropes"
                                                   :on-click #(list-tropes (:trope-code @form-data))}]
                                          [:div {:id "trope-list-container"}
                                           [:ul
                                            (for [trope (:tropes @state)]
                                              [:li {:dangerouslySetInnerHTML {:__html (trope "text")}}])
                                            ]
                                           ]]
         :else "Nope"
         )])
    ))
