{{/* Shared empty / error / pending state blocks. state-empty — genuine empty state (no data yet, nothing to show) state-error — request failed; includes optional Retry button state-pending — in-flight indicator (spinner + optional label) Fields (all optional unless noted): .Title string — main heading text .Subtext string — secondary supporting copy .Icon string — icon sprite id (defaults per block) .ActionURL string — primary CTA href (state-empty only) .ActionLabel string — primary CTA label (state-empty only) .RetryURL string — htmx GET URL for retry (state-error only) .RetryTarget string — htmx target selector (default: "closest [data-state-container]") */}} {{ define "state-empty" }}
{{ or .Title "Nothing here yet." }}
{{ if .Subtext }}{{ .Subtext }}
{{ end }} {{ if and .ActionURL .ActionLabel }} {{ .ActionLabel }} {{ end }}{{ or .Title "Something went wrong" }}
{{ if .Subtext }}{{ .Subtext }}
{{ end }} {{ if .RetryURL }} {{ if .RetryTarget }} {{/* Partial retry: swap just the container back in via htmx. */}} {{ else }} {{/* Full-page retry: regular anchor, falls back gracefully without htmx. */}} Try again {{ end }} {{ end }}{{ .Title }}
{{ end }}