 (defn item-select [idx item]
   [:select {:value (:id item)
             :on-change (fn [event]
-                         (swap! app
-                                #(assoc-in %
-                                   [:recommended idx]
-                                   (get-in % [:items %2]))
-                                (int (-> event .-target .-value))))}
+                         (let [item-id (int (-> event .-target .-value))]
+                           (swap! app assoc-in [:recommended idx]
+                                  (@items item-id))))}
    (for [[id {name :name}] (sort-by (comp :name val) @items)]
      [:option {:key id :value id} name])])
 


(defn item-recommendation [recommended]
  [:div.media-list
   (map item-component
        (range)
        recommended)])


                   stat-optimized? (as-> el [:b el]))]]))])

(defn item-block [id block]
  (let [items (mapv #(get @items (int (:id %))) (:items block))]
   [:div.panel.panel-default
    [:div.panel-heading
     [:input.form-control
      {:type "text"
       :on-change #(swap! app assoc-in [:itemset :blocks id :type] (-> % .-target .-value))
       :value (:type block)}]]
    [:div.panel-body
     (for [item items]
       [:span {:key (:id item)}
        [item-image item]])]]))

(defn item-set [itemset]
  (let [blocks (map vector (range) (:blocks itemset))]
