(defcomp
  ()
  (div
    (~tw :tokens "space-y-3")
    (div
      :sx-sse "/sx/(geography.(hypermedia.(reference.(api.sse-time))))"
      :sx-sse-swap "time"
      :sx-swap "innerHTML"
      :sx-on:sx:sseOpen "document.getElementById('ref-evt-sseopen-status').textContent = 'Connected'; document.getElementById('ref-evt-sseopen-status').className = 'inline-block px-2 py-0.5 rounded text-xs bg-emerald-100 text-emerald-700'"
      (div
        (~tw :tokens "flex items-center gap-3")
        (span
          :id "ref-evt-sseopen-status"
          (~tw :tokens "inline-block px-2 py-0.5 rounded text-xs bg-amber-100 text-amber-700")
          "Connecting...")
        (span (~tw :tokens "text-sm text-stone-500") "SSE stream")))
    (p
      (~tw :tokens "text-xs text-stone-400")
      "The status badge turns green when the SSE connection opens.")))
