{{ define "health-badge" }}
{{ if .Pending }}
{{ icon "refresh-ccw" "size-3 animate-spin" }} Checking…
{{ else if not .Reachable }}
{{/* Branch on classified reason so the tooltip tells operators what
kind of failure they're seeing, not just "it's down". */}}
{{ if eq .Reason "dns" }}
{{ icon "triangle-alert" "size-3" }} DNS failed
{{ else if eq .Reason "tls" }}
{{ icon "triangle-alert" "size-3" }} TLS error
{{ else if eq .Reason "refused" }}
{{ icon "triangle-alert" "size-3" }} Refused
{{ else if eq .Reason "timeout" }}
{{ icon "triangle-alert" "size-3" }} Timeout
{{ else if eq .Reason "http" }}
{{ icon "triangle-alert" "size-3" }} HTTP error
{{ else }}
{{ icon "triangle-alert" "size-3" }} Offline
{{ end }}
{{ end }}
{{ end }}