 (ns leftover.ui
   (:require-macros  [cljs.core.async.macros :refer [go]])
   (:require 
+    [leftover.util :as util]
     [om.core :as om :include-macros true]
     [om-tools.dom :as dom :include-macros true]
     [cljs.core.async :refer [put! chan <! >! close!]]

        (dom/div {:class "col-sm-6 component"}
                 (dom/form
                   (obi/input {:type "text" :placeholder "Location" :value location :on-change #(handle-change % owner :location)})
                   (obi/input {:type "text" :placeholder "Amount" :value amount :on-change #(handle-change % owner :amount)})
                   (obb/button-group {:justified? true}
                                     (obb/button-group {} (obb/button { :bs-style "success" :on-click (fn [e] (.preventDefault e) (add-payment actions owner state) nil) } "Add")))))))))


  [name str]
  (cond
    (empty? str) {name "is empty"}
    (not (re-matches #"^\d+(\.\d+)$" str)) {name "is not a number"})) 

(defn payment-errors
  [{:keys [location amount]}]
