        :disabled "disabled"
        :value @suggested-hyphenation}]]))
 
+(defn feedback-alert []
+  (let [msg (:message @feedback)
+        klass (if-let [kind (:kind @feedback)]
+                (str "alert alert-" (name kind))
+                "alert")]
+    [:div {:class klass :role "alert"} msg]))
+
 (defn new-hyphenation []
   [:div.form
    [spelling-filter]
    [word-field]
    [suggested-hyphenation-field]
    [hyphenation-field]
-   [hyphenation-add-button]])
+   [hyphenation-add-button]
+   (when (not= :none (:kind @feedback))
+     [feedback-alert])])
 
 (defn hyphenation-list []
   [:div.container

            :response-format :json
            :keywords? true))

(defn reset-all! []
  (reset! feedback {:message "Word successfully added" :kind :success})
  (reset! word "")
  (reset! hyphenation "")
  (reset! suggested-hyphenation "")

    :spelling 1
    :word ""
    :hyphenation ""
    :suggested-hyphenation ""
    :feedback {:message "" :kind :none}}))

(def spelling (reagent/cursor app-state [:spelling]))
(def word (reagent/cursor app-state [:word]))
(def hyphenation (reagent/cursor app-state [:hyphenation]))
(def suggested-hyphenation (reagent/cursor app-state [:suggested-hyphenation]))
(def feedback (reagent/cursor app-state [:feedback]))

(defn update-hyphenations! [f & args]
  (apply swap! app-state update-in [:hyphenations] f args))
