feat: some ui updates
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user