    :stroke "gray"})
 
 (defn- shape-render
-  [own {:keys [x y] :as shape}]
-  (let [local (:rum/local own)]
+  [own {:keys [id x y width height] :as shape}]
+  (let [local (:rum/local own)
+        selected (rum/react wb/selected-state)]
     (html
      [:g {
           :on-mouse-down
           (fn [event]
-            (println "mouse-down")
+            (swap! local assoc :init-coords [x y])
             (rx/push! wb/selected-shape-b shape))
 
-          ;; :on-mouse-move
-          ;; (fn [event]
-          ;;   (when (:drop @local)
-          ;;     (println "mouse-move" @wb/mouse-position2)
-          ;;     (let [target (.-currentTarget event)
-          ;;           [nx ny] @wb/mouse-position2
-          ;;           svg (aget (.-childNodes target) 0)]
-          ;;       (.setAttribute svg "x" nx)
-          ;;       (.setAttribute svg "y" ny)))
-          ;;   false)
+          :on-click
+          (fn [ev]
+            (when (= (:init-coords @local) [x y])
+              (rs/emit! (dw/select-shape id))
+              (println "click")))
 
           :on-mouse-up
           (fn [event]

            (rx/push! wb/selected-shape-b :nothing)
            (dom/stop-propagation event))
          }
      (shapes/render shape)])))

;; (defn- shape-render
;;   [own shape]

            [uxbox.shapes :as shapes]
            [uxbox.library.icons :as _icons]
            [uxbox.data.projects :as dp]
            [uxbox.data.workspace :as dw]
            [uxbox.ui.mixins :as mx]
            [uxbox.ui.dom :as dom]
            [uxbox.ui.util :as util]
