 ;; ----------------------------------------------------------------------------
 
 (defn render-board
-  [board suggestions cb]
+  [board suggestions interactions]
   (into
     (empty-svg-board)
     (for [[position cell] (board/to-seq board)]
       ^{:key position}
       (if (= :none cell)
-        [empty-cell position cb
-         (if (and suggestions (suggestions position))       ;; Avoids crash !
-           :help :none)]
+        [empty-cell position interactions
+         (if (suggestions position) :help :none)]
         [rect-cell position cell])
       )))

     options)])

(defn- empty-cell
  [[x y :as position] cb player]
  (rect-cell position player
    {:on-click #(cb/on-player-move cb x y)}))

(defn- empty-svg-board []
  [:svg.board

(ns triboard.view.board
  (:require
    [triboard.logic.board :as board]
    [triboard.view.interactions :as i]
    [triboard.view.utils :as vutils]))


;; ----------------------------------------------------------------------------
;; Private
;; ----------------------------------------------------------------------------

(def relative-size 0.9)
(def border-size (/ (- 1 relative-size) 2))
