(ns auto-ap.views.pages.company.side-bar
  (:require
   [auto-ap.routes :as routes]
   [auto-ap.subs :as subs]
   [auto-ap.views.utils :refer [active-when]]
   [bidi.bidi :as bidi]
   [re-frame.core :as re-frame]))

(defn company-side-bar []
  (let [ap @(re-frame/subscribe [::subs/active-page])]
    [:div
     [:ul.menu-list
      [:li.menu-item
       [:a.item {:href (bidi/path-for routes/routes :reports)
                 :class [(active-when ap = :reports)]}
        [:span {:class "icon icon-receipt" :style {:font-size "25px"}}]
        [:span {:class "name"} "Reports"]]]]
     [:li.menu-item
      [:a {:href (bidi/path-for routes/routes :plaid), :class (str "item" (active-when ap = :plaid))}
       [:span {:class "icon icon-saving-bank-1" :style {:font-size "25px"}}]
       [:span {:class "name"} "Plaid Link"]]]
     [:li.menu-item
      [:a {:href (bidi/path-for routes/routes :yodlee2), :class (str "item" (active-when ap = :yodlee2))}
       [:span {:class "icon icon-saving-bank-1" :style {:font-size "25px"}}]
       [:span {:class "name"} "Yodlee Link"]]]
     [:li.menu-item
      [:a {:href (bidi/path-for routes/routes :company-other), :class (str "item" (active-when ap = :company-other))}
       [:span {:class "icon icon-cog-play-1" :style {:font-size "25px"}}]
       [:span {:class "name"} "Other"]]]]))
