        :value       "udp"
        :primaryText "UDP"})))
 
+(defn- form-mode [value index]
+  (list/selectfield
+    {:name     (str "form-mode-select-" index)
+     :key      (str "form-mode-select-" index)
+     :value    value
+     :onChange (fn [_ _ v]
+                 (state/update-item index :mode v form-value-cursor))}
+    (comp/menu-item
+      {:name        (str "form-mode-ingress-" index)
+       :key         (str "form-mode-ingress-" index)
+       :value       "ingress"
+       :primaryText "ingress"})
+    (comp/menu-item
+      {:name        (str "form-mode-host-" index)
+       :key         (str "form-mode-host-" index)
+       :value       "host"
+       :primaryText "host"})))
+
 (defn- form-host [value index]
   (list/textfield
     {:name     (str "form-host-text-" index)

     :on-success (fn [{:keys [response]}]
                   (doseq [port response]
                     (if (not-suggested? port)
                       (state/add-item port form-value-cursor))))
     :on-error   (fn [_])}))

(def headers [{:name  "Container port"
               :width "100px"}
              {:name  "Protocol"
               :width "100px"}
              {:name  "Host port"
               :width "100px"}])


  []
  (state/add-item {:containerPort 0
                   :protocol      "tcp"
                   :mode          "ingress"
                   :hostPort      0} form-value-cursor))

(rum/defc form < rum/reactive []
