   (let [local (:rum/local own)
         collections (->> (mx/react collections-ref)
                          (vals)
+                         (filter :id)
                          (sort-by :name))
-        collection (get-selected-collection local collections)]
+        selected-collection (get-selected-collection local collections)]
     (letfn [(select-collection [event]
               (let [value (read-string (dom/event->value event))]
                 (swap! local assoc :selected value :position 0)))

  [local collections]
  (if-let [selected (:selected @local)]
    (first (filter #(= selected (:id %)) collections))
    (first collections)))

(mx/defc palette-items
  {:mixins [mx/static]}

        [:select.input-select {:on-change select-collection}
         (for [collection collections]
           [:option {:key (str (:id collection))
                     :value (pr-str (:id collection))
                     :selected (when (= collection selected-collection) "selected")}
            (:name collection)])]
        #_[:div.color-palette-buttons
           [:div.btn-palette.edit.current i/pencil]
           [:div.btn-palette.create i/close]]]
