        [:ul.element-list
         (for [shape (map #(get shapes-by-id %) (:shapes page))
               :let [key (str (:id shape))]]
-          ;; TODO: make polymorphic
-          (case (:type shape)
-            :builtin/rect (rum/with-key (layer-element shape selected) key)
-            :builtin/circle (rum/with-key (layer-element shape selected) key)
-            :builtin/line (rum/with-key (layer-element shape selected) key)
-            :builtin/icon (rum/with-key (layer-element shape selected) key)
-            :builtin/group (rum/with-key (layer-group shape selected) key)))]]
+          (if (= (:type shape) :builtin/group)
+            (-> (layer-group shape selected)
+                (rum/with-key key))
+            (-> (layer-element shape selected)
+                (rum/with-key key))))]]
       [:div.layers-tools
        [:ul.layers-tools-content
-        [:li.clone-layer {:on-click copy}
-         i/copy]
-        [:li.group-layer {:on-click group}
-         i/folder]
-        [:li.delete-layer {:on-click delete}
-         i/trash]]]])))
+        [:li.clone-layer {:on-click copy} i/copy]
+        [:li.group-layer {:on-click group} i/folder]
+        [:li.delete-layer {:on-click delete} i/trash]]]])))
 
 (def ^:static layers-toolbox
   (mx/component

  (dom/stop-propagation event)
  (let [id (:id item)]
    (rs/emit! (dw/toggle-shape-locking id))))

(defn- layer-element-render
  [own item selected]

     [:li {:key (str (:id item))
           :on-click select
           :class (when selected? "selected")}
      [:div.element-list-body
       {:class (when selected? "selected")}
       [:div.element-actions
        [:div.toggle-element
         {:class (when-not (:hidden item) "selected")
          :on-click toggle-visibility}
         i/eye]
        [:div.block-element
         {:class (when (:blocked item) "selected")
          :on-click toggle-blocking}
         i/lock]]
       (if (:group item)
         [:div.sublevel-element i/sublevel])
       [:div.element-icon (element-icon item)]
       [:span (:name item "Unnamed")]]])))

(def ^:static ^:private layer-element
  (mx/component
