(defcomp
  ()
  (div
    (~tw :tokens "space-y-3")
    (button
      :sx-get "/sx/(geography.(hypermedia.(reference.(api.error-500))))"
      :sx-target "#ref-evt-err-result"
      :sx-swap "innerHTML"
      :sx-on:sx:responseError "var s=document.getElementById('ref-evt-err-status'); s.style.display='block'; s.textContent='Error ' + (event.detail ? event.detail.status || '?' : '?') + ' received'"
      (~tw :tokens "px-4 py-2 bg-violet-600 text-white rounded hover:bg-violet-700 transition-colors text-sm")
      "Call failing endpoint")
    (div
      :id "ref-evt-err-status"
      (~tw :tokens "p-2 rounded bg-red-50 text-red-600 text-sm")
      :style "display: none"
      "")
    (div
      :id "ref-evt-err-result"
      (~tw :tokens "p-3 rounded bg-stone-100 text-stone-400 text-sm")
      "Click to trigger an error — the sx:responseError event fires.")))
