feat: add retry action to unavailable states
CI / backend-and-migrations (push) Failing after 5m20s
CI / astro-build (push) Failing after 6m40s
CI / dependency-audit (push) Failing after 5m54s
CI / compose-e2e (push) Failing after 7m41s

This commit is contained in:
ik
2026-09-22 20:47:16 +07:00
parent dce413fd81
commit 53083fab1e
+3 -1
View File
@@ -1,8 +1,10 @@
---
const { title, description, actionHref, actionLabel, tone = "empty", compact = false, contained = true } = Astro.props as { title: string; description?: string; actionHref?: string; actionLabel?: string; tone?: "empty" | "error" | "unavailable"; compact?: boolean; contained?: boolean };
const retryHref = actionHref ?? (tone === "unavailable" ? `${Astro.url.pathname}${Astro.url.search}` : undefined);
const retryLabel = actionLabel ?? (tone === "unavailable" ? "Повторить загрузку" : undefined);
---
<div class:list={["state", { "content-grid": contained, "compact-state": compact, "error-state": tone === "error", "unavailable-state": tone === "unavailable" }]} role={tone === "empty" ? "status" : "alert"}>
<h2>{title}</h2>
{description && <p>{description}</p>}
{actionHref && actionLabel && <a data-action="secondary" href={actionHref}>{actionLabel}</a>}
{retryHref && retryLabel && <a data-action="secondary" href={retryHref}>{retryLabel}</a>}
</div>