fix: label tackle catalog count accurately

This commit is contained in:
ik
2026-09-22 20:20:01 +07:00
parent 1da9279ddf
commit 54fae57f9c
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -2,9 +2,9 @@
import FishSilhouette from "./FishSilhouette.astro"; import FishSilhouette from "./FishSilhouette.astro";
import WaterbodyMark from "./WaterbodyMark.astro"; import WaterbodyMark from "./WaterbodyMark.astro";
import AtlasPairMark from "./AtlasPairMark.astro"; import AtlasPairMark from "./AtlasPairMark.astro";
const { eyebrow, title, description, variant, count, identity = title, secondaryIdentity = "waterbody" } = Astro.props as { eyebrow: string; title: string; description?: string; variant?: "water" | "fish" | "pair"; count?: number; identity?: string; secondaryIdentity?: string }; const { eyebrow, title, description, variant, count, countLabel, identity = title, secondaryIdentity = "waterbody" } = Astro.props as { eyebrow: string; title: string; description?: string; variant?: "water" | "fish" | "pair"; count?: number; countLabel?: string; identity?: string; secondaryIdentity?: string };
--- ---
<section class:list={["catalog-hero content-grid", { "catalog-hero--illustrated": variant }]}> <section class:list={["catalog-hero content-grid", { "catalog-hero--illustrated": variant }]}>
<div class="catalog-hero__copy"><span class="overline">{eyebrow}</span><h1>{title}</h1>{description && <p>{description}</p>}</div> <div class="catalog-hero__copy"><span class="overline">{eyebrow}</span><h1>{title}</h1>{description && <p>{description}</p>}</div>
{variant && <div class:list={["catalog-hero__seal", { "catalog-hero__seal--pair": variant === "pair" }]} aria-hidden="true"><span>{variant === "water" ? <WaterbodyMark identity={identity} size={94} /> : variant === "pair" ? <AtlasPairMark waterbody={secondaryIdentity} fish={identity} /> : <FishSilhouette name={identity} size={92} />}</span>{typeof count === "number" && <><strong>{String(count).padStart(2,"0")}</strong><small>{variant === "water" ? "водоёмов" : "видов рыб"}</small></>}</div>} {variant && <div class:list={["catalog-hero__seal", { "catalog-hero__seal--pair": variant === "pair" }]} aria-hidden="true"><span>{variant === "water" ? <WaterbodyMark identity={identity} size={94} /> : variant === "pair" ? <AtlasPairMark waterbody={secondaryIdentity} fish={identity} /> : <FishSilhouette name={identity} size={92} />}</span>{typeof count === "number" && <><strong>{String(count).padStart(2,"0")}</strong><small>{countLabel ?? (variant === "water" ? "водоёмов" : "видов рыб")}</small></>}</div>}
</section> </section>
+1 -1
View File
@@ -53,7 +53,7 @@ const itemsParams = new URLSearchParams(filterParams);
const rigsParams = new URLSearchParams(search ? { q: search } : {}); const rigsParams = new URLSearchParams(search ? { q: search } : {});
--- ---
<Layout title="Снасти и приманки RF4 — RF4 Spotter" description="Канонический каталог снастей, приманок и сборок Russian Fishing 4 с источниками и отметками неполноты." noindex={unavailable || invalidFilters} errorPage={false}> <Layout title="Снасти и приманки RF4 — RF4 Spotter" description="Канонический каталог снастей, приманок и сборок Russian Fishing 4 с источниками и отметками неполноты." noindex={unavailable || invalidFilters} errorPage={false}>
<PageHero eyebrow="Канонический справочник" title="Снасти и приманки" description="Показываем только подтверждённые карточки. Пустые поля явно отмечены и не заменяются догадками." variant="fish" count={result.total} /> <PageHero eyebrow="Канонический справочник" title="Снасти и приманки" description="Показываем только подтверждённые карточки. Пустые поля явно отмечены и не заменяются догадками." variant="fish" count={result.total} countLabel="карточек" />
<form class="record-filters" method="get" aria-label="Фильтры каталога снастей"> <form class="record-filters" method="get" aria-label="Фильтры каталога снастей">
<label>Категория<select name="category"><option value="">Все категории</option>{Object.entries(categoryLabels).map(([value, label]) => <option value={value} selected={category === value}>{label}</option>)}</select></label> <label>Категория<select name="category"><option value="">Все категории</option>{Object.entries(categoryLabels).map(([value, label]) => <option value={value} selected={category === value}>{label}</option>)}</select></label>
<label>Поиск<input name="q" value={search} maxlength="100" placeholder="Название снасти или приманки" /></label> <label>Поиск<input name="q" value={search} maxlength="100" placeholder="Название снасти или приманки" /></label>