 (ns gtfve.components.side-panel
+  (:require-macros [cljs.core.async.macros :refer [go go-loop]])
   (:require [clojure.string :refer [join]]
+            [cljs.core.async :as async :refer [put! chan <! close! >!]]
             [om.core :as om]
             [sablono.core :as html :refer-macros [html]]
             [gtfve.async :refer [raise!]]
             [gtfve.state :as state]
-            [gtfve.utils :as utils]))
+            [gtfve.utils :as utils])
+  (:import [goog.events EventType]))
 
 (defn side-panel-tab [{:keys [key label tab]} owner]
   (reify

                (om/build side-panel-tab {:key :trips
                                          :label "Trips"
                                          :tab tab})]
               [:div.tab-content
                ;; stops
                (om/build stop-panel {:panel panel :data (:stops data)})
                ;; routes
                (om/build route-panel {:panel panel :data (:routes data)})
                ;; trips
                (om/build trip-panel {:panel panel :data (:trips data)})]])))))

                             (raise! owner [:side-panel-changed {:key key}])
                             (.preventDefault e))} label]]))))

(defn ^:private tab-class [active? in?]
  (join " "
        ["tab-pane" "fade" "side"
         (when active? "active")
         (when in? "in")]))

(defn stop-panel [{:keys [panel data active? in?]} owner]
  (reify
    om/IDisplayName (display-name [_] "Stop Panel")
    om/IRender
