fix(landing): счётчик продуктов подменяет только числовую плашку, а не «AI — в каждом продукте»
This commit is contained in:
@@ -182,7 +182,8 @@ export function Landing() {
|
|||||||
{Array.isArray(hero?.stats) && hero.stats.length > 0 && (
|
{Array.isArray(hero?.stats) && hero.stats.length > 0 && (
|
||||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 mt-14 pt-7 border-t border-slate-200">
|
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 mt-14 pt-7 border-t border-slate-200">
|
||||||
{hero.stats.map((stat: any, idx: number) => {
|
{hero.stats.map((stat: any, idx: number) => {
|
||||||
const isProd = typeof stat.label === 'string' && stat.label.toUpperCase().includes('ПРОДУКТ');
|
// Подменяем только счётчик продуктов (число), а не любую подпись со словом «продукт»
|
||||||
|
const isProd = typeof stat.label === 'string' && /^\d+$/.test(String(stat.value).trim()) && stat.label.toUpperCase().includes('ПРОДУКТ');
|
||||||
const value = isProd ? String(productCount) : stat.value;
|
const value = isProd ? String(productCount) : stat.value;
|
||||||
const label = isProd ? pluralProducts(productCount) : stat.label;
|
const label = isProd ? pluralProducts(productCount) : stat.label;
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user