   (let [team-id (aget js-evt "currentTarget" "value")]
     (swap! page-state assoc-in [:games game-id team-key] team-id)))
 
+;; TODO: put the team record in here
 (rum/defc TeamOption < rum/static
   [[team-id team]]
   [:option {:value (name team-id)}

(defn- compare-team-name [[teamA-id teamA] [teamB-id teamB]]
  (compare (:name teamA) (:name teamB)))

;; TODO: use a faster component for team selection than a <select>
(rum/defc TeamSelect < rum/static
  [teams game-id game team-key]
  (let [sorted-teams (sort compare-team-name teams)]

;; Init
;;------------------------------------------------------------------------------

(def init!
  "Initialize the Admin page.
   NOTE: this function may only be called one time."
  (once
    (fn []
      ;; do they have the password in localStorage?
      (if-not (blank? (:password @page-state))
        ;; attempt to login
        (click-login-btn nil)
        ;; else trigger an initial render
        (swap! page-state identity)))))

(init!)
