(ns auto-ap.views.components.button-radio)

(defn button-radio [{:keys [options on-change value disabled]}]
  [:div.control
   [:div.field.has-addons
    (for [[k v] options]
      ^{:key k}
      [:p.control
       [:a.button {:class (if (= value k)
                            "is-primary"
                            "")
                   :disabled disabled
                   :on-click (fn [] (on-change k))} v]])]])
