 (ns swarmpit.component.service.list
-  (:require [material.component :as comp]
+  (:require [material.icon :as icon]
+            [material.component :as comp]
             [swarmpit.component.state :as state]
             [swarmpit.component.mixin :as mixin]
             [swarmpit.component.handler :as handler]

(defn- render-item-ports [value]
  (html
    (for [port value]
      [:div (str (:hostPort port) " ➟ " (:containerPort port) "/" (:protocol port))])))

(defn- render-item-info [value mode]
  (html
    (if (= "global" mode)
      [:span
       [:span (comp/label-info value)]
       [:span " "]
       [:span.label.label-info [:b "G"]]]
      [:span (comp/label-info value)])))

(defn- render-status [value update-status]
  (if (or (= "updating" update-status)

              {:name  "Ports"
               :width "15%"}
              {:name  "Status"
               :width "20%"}])

(def render-item-keys
  [[:serviceName] [:repository :image] [:status :info] [:ports] [:state]])
