   (:require [material.component :as comp]
             [material.icon :as icon]
             [swarmpit.url :refer [dispatch!]]
-            [swarmpit.component.mixin :as mixin]
             [swarmpit.component.handler :as handler]
             [swarmpit.component.service.form-ports :as ports]
             [swarmpit.component.service.form-networks :as networks]

(rum/defc form-tasks < rum/static [tasks]
  [:div.form-view-group
   (comp/form-section "Tasks")
   (comp/list-table tasks/headers
                    (filter #(not (= "shutdown" (:state %))) tasks)
                    tasks/render-item
                    tasks/render-item-keys
                    tasks/onclick-handler)])

(rum/defc form < rum/reactive
                 init-state-mixin [service]
  (let [networks (rum/react service-networks)
        tasks (rum/react service-tasks)
        ports (:ports service)
        mounts (:mounts service)
        secrets (:secrets service)

                   (message/error
                     (str "Service removing failed. Reason: " (:error response))))}))

(rum/defc form-settings < rum/static [service]
  [:div.form-view-group
   (comp/form-section "General settings")
