         {:header (if workspace-id "Clone Workspace" "Create New Workspace")
          :ok-button {:text (if workspace-id "Clone Workspace" "Create Workspace")
                      :data-test-id (config/when-debug "create-workspace-button")
-                     :onClick #(this :-create-workspace)}
+                     :onClick (if workspace-id #(this :-do-clone) #(this :-create-workspace))}
          :dismiss (:dismiss props)
          :get-first-element-dom-node #(@refs "project")
          :content

                        (do (modal/pop-modal)
                            (nav/go-to-path :workspace-summary {:namespace project :name name}))
                        (swap! state assoc :server-error (get-parsed-response false))))}))))
   :-auth-domain-builder
   (fn [{:keys [state props]}]
     (let [{:keys [all-groups selected-groups]} @state

               :data-test-id (config/when-debug "workspace-auth-domain-select")
               :onChange #(swap! state update :selected-groups conj (-> % .-target .-value))}
              (set/difference all-groups (set selected-groups))
              (str "Select " (if (empty? selected-groups) "a" "another") " Group..."))])
          (common/clear-both)])))})


(react/defc Button
