             [sablono.core :as html :refer-macros [html]]
             [cljs-http.client :as http]
             [cljs.core.async :refer [<! >! chan]]
-            [searchbot.meta :refer [widget-wrapper detail]]))
+            [searchbot.meta :refer [widget-wrapper detail]]
+            [clojure.string :as string]))
 
 ;;;;;;;;;;;;;
 ;; searchbox

                  (html [:.card
                         [:.card-content
                          [:span.card-title.black-text "searching in "
                           [:strong (str "/" (:es-index opts) "/" (:es-type opts))]
                           [:a.btn-floating.btn-flat.waves-effect.activator.white.right
                            [:i.mdi-action-settings.grey-text]]]
                          [:.input-field

  [owner result]
  (om/set-state! owner :query-result result))

(defn- join-str [& tokens]
  (->> tokens (filter (comp not string/blank?)) (string/join "/") (str "/")))

(defcomponent searchbox [cursor owner opts]
  (will-mount [_]
              (update-searchbox owner "")
