       [:div.btn-group
        [:button.btn.btn-default
         {:on-click save
-         :disabled (when-not valid? "disabled")}
+         :disabled (when (or (not valid?) same-as-suggested?) "disabled")}
         [:span.glyphicon.glyphicon-ok {:aria-hidden true}] " Save"]
        [:button.btn.btn-default
         {:on-click stop}

   :format :json))

(defn lookup-hyphenation-pattern!
  [spelling word]
  (ajax/GET "/api/hyphenate"
   :params {:word word :spelling spelling}
   :handler (fn [hyphenated]
              (do
                (swap! app-state assoc :suggested-hyphenation hyphenated)
                (swap! app-state assoc :hyphenation hyphenated)))
   :error-handler (fn [details]
                    (.warn js/console
                           (str "Failed to lookup hyphenation patterns for word: " details)))))

(defn hyphenation-pattern-ui [{:keys [word hyphenation]}]
  [:tr

      [:span.glyphicon.glyphicon-trash {:aria-hidden true}] " Delete"]]]])

(defn- hyphenation-pattern-edit-ui
  [word new-hyphenation new-suggestion stop save]
  (let [valid? (hyphenation-valid? @new-hyphenation word)
        same-as-suggested? (= @new-hyphenation @new-suggestion)
        klass (cond
                (not valid?) "has-error"
                same-as-suggested? "has-warning")
        help-text (cond
                    (not valid?) "The hyphenation is not valid"
                    same-as-suggested? "The hyphenation is the same as the suggestion")]
    [:tr
     [:td word]
     [:td
