feat: recover from invalid filter states
CI / backend-and-migrations (push) Failing after 5m15s
CI / astro-build (push) Failing after 6m41s
CI / dependency-audit (push) Failing after 5m53s
CI / compose-e2e (push) Failing after 7m43s

This commit is contained in:
ik
2026-09-22 20:49:05 +07:00
parent 53083fab1e
commit f476568869
+2 -2
View File
@@ -1,7 +1,7 @@
--- ---
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 { 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 retryHref = actionHref ?? (tone === "unavailable" ? `${Astro.url.pathname}${Astro.url.search}` : tone === "error" ? Astro.url.pathname : undefined);
const retryLabel = actionLabel ?? (tone === "unavailable" ? "Повторить загрузку" : undefined); const retryLabel = actionLabel ?? (tone === "unavailable" ? "Повторить загрузку" : tone === "error" ? "Вернуться к разделу" : undefined);
--- ---
<div class:list={["state", { "content-grid": contained, "compact-state": compact, "error-state": tone === "error", "unavailable-state": tone === "unavailable" }]} role={tone === "empty" ? "status" : "alert"}> <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> <h2>{title}</h2>