<commit_before>(ns braid.search.ui.search-page
  (:require
   [re-frame.core :refer [dispatch subscribe]]
   [reagent.core :as r]
   [reagent.ratom :include-macros true :refer-macros [reaction]]
   [braid.core.client.ui.views.thread :refer [thread-view]]))

(defn search-page-view
  []
  (let [page (subscribe [:page])
        threads (subscribe [:threads])
        query (subscribe [:braid.search/query])
        group-id (subscribe [:open-group-id])
       status (cond
                   (@page :search-error?) :error
                   (@page :loading?) :loading
                   (not (contains? @page :thread-ids)) :searching
                   (seq (@page :thread-ids)) :done-results
                   :else :done-empty)]
    (case status
      :searching
      [:div.page.search
       [:div.title (str "Search for \"" @query "\"")]
       [:div.content
        [:div.description
         "Searching..."]]]

      :error
      [:div.page.search
       [:div.title (str "Search for \"" @query "\"")]<commit_msg>Remove unused requires<commit_after>(ns braid.search.ui.search-page
  (:require
   [re-frame.core :refer [dispatch subscribe]]
   [braid.core.client.ui.views.thread :refer [thread-view]]))

(defn search-page-view
  []
  (let [page (subscribe [:page])
        threads (subscribe [:threads])
        query (subscribe [:braid.search/query])
        group-id (subscribe [:open-group-id])
       status (cond
                   (@page :search-error?) :error
                   (@page :loading?) :loading
                   (not (contains? @page :thread-ids)) :searching
                   (seq (@page :thread-ids)) :done-results
                   :else :done-empty)]
    (case status
      :searching
      [:div.page.search
       [:div.title (str "Search for \"" @query "\"")]
       [:div.content
        [:div.description
         "Searching..."]]]

      :error
      [:div.page.search
       [:div.title (str "Search for \"" @query "\"")]
{'fraction_non_alphanumeric': 0.16377551020408163, 'fraction_numerical': 0.0, 'mean_word_length': 2.0403100775193797, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1064895', 'n_tokens_mistral': 615, 'n_tokens_neox': 590, 'n_words': 136}