        :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)

  [item index _]
  (let [{:keys [containerPort
                protocol
                hostPort]} item]
    [(form-container containerPort index)
     (form-protocol protocol index)
     (form-host hostPort index)]))

(defn- form-table

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

(rum/defc form < rum/reactive []
