   ;(s/protocol)) 
 
 ;; Should actually try to tackle this
-
-
-(def default-box-style
-  {:border "2px solid grey"
-   :margin "7px"
-   :background-color "#E5FFF6"})
-
-(def default-pull-data-view-style
-  (merge h-box-styles
-         default-box-style
-         {:padding "15px 15px"
-          :width "100%"}))
 
 ;(s/defn pull-data-view :- Hiccup
   ;"Given a DS connection, a datview pull-expression and data from that pull expression (possibly as a reaction),


(declare pull-data-view)

(defn value-view
  [conn pull-expr attr-ident value]
  (let [attribute-signature (attribute-signature-reaction conn attr-ident)]
    (fn [_ pull-expr attr-ident value]
      [re-com/v-box
       :padding "3px"
       :children
       [(match [@attribute-signature]
          ;; For now, all refs render the same; May treat component vs non-comp separately later
          [{:db/valueType :db.type/ref}]
          [pull-data-view conn (get-nested-pull-expr pull-expr attr-ident) value]
          ;; Miscellaneous value
          :else
          (str value))]])))

(defn collapse-summary
  [conn attr-ident values]

  "Returns the corresponding attr-ident entry from `datomic-schema-index-reaction`."
  (memoize
    (fn [conn attr-ident]
      (posh/pull conn
                 '[* {:db/valueType [:db/ident]} {:db/cardinality [:db/ident]}]
                 [:db/ident attr-ident]))))

;; Another function gives us a version of this that maps properly to idents
(def attribute-signature-reaction
  "Reaction of the pull of a schema attribute, where any references to something with an ident
  have been replaced by that ident keyword."
  (memoize
    (fn [conn attr-ident]
      (let [schema-rx (attribute-schema-reaction conn attr-ident)]
        (reaction
          (into {}
            (map (fn [[k v]] [k (if-let [ident (:db/ident v)] ident v)])
                 @schema-rx)))))))


;; This code below may get better performance once we get the new posh stuff working...
;; It would be nice though if we had some benchmarking stuff set up to be rigorous.
