feat: some ui updates

This commit is contained in:
ivannoskov
2026-01-07 15:46:30 +03:00
parent 3b6b97447b
commit 073be940b5
9 changed files with 840 additions and 722 deletions

View File

@@ -92,6 +92,25 @@ const formatCurrency = (value: number | null | undefined): string => {
}).format(value);
};
const getCreativeWord = (count: number): string => {
const mod10 = count % 10;
const mod100 = count % 100;
if (mod100 >= 11 && mod100 <= 14) {
return "креативов";
}
if (mod10 === 1) {
return "креатив";
}
if (mod10 >= 2 && mod10 <= 4) {
return "креатива";
}
return "креативов";
};
// ============================================================================
// Component
// ============================================================================
@@ -217,7 +236,7 @@ export default function CreativesPage() {
<div>
<h1 className="text-2xl font-bold tracking-tight">Креативы</h1>
<p className="text-muted-foreground">
{filteredCreatives.length} креативов {formatCurrency(totals.cost)} {" "}
{filteredCreatives.length} {getCreativeWord(filteredCreatives.length)} {formatCurrency(totals.cost)} {" "}
{formatNumber(totals.subscriptions)} подписчиков
</p>
</div>