   (:require [om.core :as om :include-macros true]
             [sablono.core :as html :refer-macros [html]]
             [kixi.hecuba.bootstrap :as bs]))
+
+(enable-console-print!)
 
 (defn get-profiles [selected-property-id data]
   (->>  data

        first
        :profiles))

(defn occupancy-row [profiles owner]
  (reify
    om/IRenderState
    (render-state [_ state]
      (let [occupancy-profiles []
            profile_data {}]
        (bs/panel
         "Occupancy"
         [:dl
          [:dt "Occupancy Under 18"] [:dd (get profile_data :occupancy_under_18 "")]
          [:dt "Occupancy 18 To 60"] [:dd (get profile_data :occupancy_18_to_60 "")]
          [:dt "Occupancy Over 60"] [:dd (get profile_data :occupancy_over_60 "")]
          [:dt "Occupant Change"] [:dd (get profile_data :occupant_change "")]])))))

(defn profile-rows [profiles owner]
  (reify

    om/IRender
    (render [_]
      (let [selected-property-id (-> data :active-components :properties)
            profiles             (sort-by :timestamp (get-profiles selected-property-id data))]
        (html
         [:div
          [:h3 "Profiles"]
          (if (seq profiles)
            (om/build profile-rows profiles)
            [:div.col-md-12.text-center
             [:p.lead {:style {:padding-top 30}}
              "No profile data to display"]])])))))
