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

@@ -54,6 +54,25 @@ const formatNumber = (value: number | null) => {
return new Intl.NumberFormat("ru-RU").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 "креативов";
};
// ============================================================================
// Types
// ============================================================================
@@ -198,7 +217,7 @@ export default function CreativesAnalyticsPage() {
<CardHeader>
<CardTitle>Креативы</CardTitle>
<CardDescription>
{sortedCreatives.length} креативов с размещениями
{sortedCreatives.length} {getCreativeWord(sortedCreatives.length)} с размещениями
</CardDescription>
</CardHeader>
<Table>