<commit_before>(ns braid.ui.views.embed
  (:require [reagent.core :as r]
            [chat.client.xhr :refer [edn-xhr]]))

(defn- arr->rgb [arr]
  (str "rgb(" (arr 0) "," (arr 1) "," (arr 2) ")"))

(defn- website-embed-view [content]
  [:div.content.loaded.website
   (if-let [img (get-in content [:images 0])]
     [:img.image {:src (img :url)
                  :style {:background-color
                          (arr->rgb (get-in img [:colors 0 :color]))}}]
     [:img.image {:src (:favicon_url content)}])
   [:div.about
    [:div.provider
     [:div.favicon {:style {:background-image
                            (str "url(" (:favicon_url content) ")")}}]
     [:div.name (:provider_name content)]]
    [:div.title (:title content)]
    [:div.url (:url content)]]])

(defn- video-overlay-view [content]
  [:div.content
   [:div.frame
    {:dangerouslySetInnerHTML {:__html (:html (:media content))}}]])

(defn- content-overlay-view [content])<commit_msg>fallback embed color if none given<commit_after>(ns braid.ui.views.embed
  (:require [reagent.core :as r]
            [chat.client.xhr :refer [edn-xhr]]))

(defn- arr->rgb [arr]
  (if arr
    (str "rgb(" (arr 0) "," (arr 1) "," (arr 2) ")")
    "rgb(150, 150, 150)"))

(defn- website-embed-view [content]
  [:div.content.loaded.website
   (if-let [img (get-in content [:images 0])]
     [:img.image {:src (img :url)
                  :style {:background-color
                          (arr->rgb (get-in img [:colors 0 :color]))}}]
     [:img.image {:src (:favicon_url content)}])
   [:div.about
    [:div.provider
     [:div.favicon {:style {:background-image
                            (str "url(" (:favicon_url content) ")")}}]
     [:div.name (:provider_name content)]]
    [:div.title (:title content)]
    [:div.url (:url content)]]])

(defn- video-overlay-view [content]
  [:div.content
   [:div.frame
    {:dangerouslySetInnerHTML {:__html (:html (:media content))}}]])

(defn- content-overlay-view [content])
{'fraction_non_alphanumeric': 0.2013151239251391, 'fraction_numerical': 0.009610520991401113, 'mean_word_length': 2.697196261682243, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5912026', 'n_tokens_mistral': 750, 'n_tokens_neox': 676, 'n_words': 163}