                          [:button
                           {:onClick #(select-party! owner party)}
                           "Select"]])
-                      (->> results
-                           (group-by #(get-in % [:party :id]))
-                           (map (fn [[_ v]] (first v)))))]
+                      (unique-parties results))]
         [:p "Can't find your RSVP? "
          [:a {:onClick #(do (.preventDefault %)
                             (reset-search! owner)

    [:main
     [:h1 "Thank you!"]
     (let [{:keys [guests] :as selection} (om/observe owner (selection))]
       [:pre (with-out-str (pp/pprint @selection))]
       [:ul
        (map (fn [{:keys [id name] :as guest}]
               [:li (str name

  (reify
    om/IRender
    (render [_]
      (html
       (let [{:keys [party] :as selection} (om/observe owner (selection))
             {:keys [infos sent] :as response} (om/observe owner (response))]
         (cond (true? sent)
               (om/build rsvp-confirmation-view response)
               
               (party-selected? owner)
               (om/build rsvp-card-view selection)
               
               (seq? results)
               (om/build rsvp-multiple-results-view data)
               
               :else (html [:main
                            [:h2 (str "Oops! No results found for '" name "'")]
                            [:p "Can't find your RSVP? "
                             [:a {:onClick #(do (.preventDefault %)
                                                (reset-search! owner)
                                                (reset-selection! owner))}
                              "Search again"]]])))))))

(defn rsvp-view [{:keys [results] :as data} owner]
  (reify om/IRender
