(ns auto-ap.views.components.address
  (:require
   [auto-ap.forms.builder :as form-builder]
   [auto-ap.views.components.level :as level]))

(defn address2-field [{:keys [value on-change]}]
  [form-builder/virtual-builder {:value     (or value {})
                                 :on-change on-change}
   [:div
    [form-builder/field-v2 {:field :street1}
     [:p.help "Street Address"]
     [:input.input.is-expanded {:type        "text"
                                :placeholder "1700 Pennsylvania Ave"}]]
    [form-builder/raw-field-v2 {:field :street2}
     [:input.input.is-expanded {:type        "text"
                                :placeholder "Suite 400"}]]
    [level/left-stack
     [form-builder/field-v2 {:field :city}
      [:p.help "City"]
      [:input.input.is-expanded {:type        "text"
                                 :placeholder "Cupertino"
                                 :field       [:city]}]]
     [form-builder/field-v2 {:field :state}
      [:p.help "State"]
      [:input.input {:type        "text"
                     :placeholder "CA"
                     :size        2
                     :max-length  "2"}]]
     [form-builder/field-v2 {:field :zip}
      [:p.help "Zip"]
      [:input.input {:type        "text"
                     :placeholder "95014"}]]]]])
