From da47a7a974597a9d11aa1839243e55ab6060ab14 Mon Sep 17 00:00:00 2001 From: smanylov Date: Fri, 9 Jan 2026 11:08:31 +0700 Subject: [PATCH] update text layout --- src/app/components/StackedBarChart.tsx | 21 ++- .../ui/marking-page/protected-files-table.tsx | 150 ------------------ .../ui/my-content/my-content-info-block.tsx | 2 +- 3 files changed, 18 insertions(+), 155 deletions(-) delete mode 100644 src/app/ui/marking-page/protected-files-table.tsx diff --git a/src/app/components/StackedBarChart.tsx b/src/app/components/StackedBarChart.tsx index 2da6902..a5d114f 100644 --- a/src/app/components/StackedBarChart.tsx +++ b/src/app/components/StackedBarChart.tsx @@ -3,6 +3,7 @@ import { useTranslations } from 'next-intl'; import { useMemo } from 'react'; import { BarChart, Bar, Cell, XAxis, Tooltip } from 'recharts'; +import { pluralize } from '@/app/lib/pluralize'; type Files = { data: { @@ -147,6 +148,16 @@ export const StackedBarChart = ({ data }: Files) => { ); }; + const pluralizeCheks = (number: number) => { + const translate = [t('check'), t('checks-few'), t('checks')]; + return pluralize(number, translate[0], translate[1], translate[2]); + }; + + const pluralizeViolations = (number: number) => { + const translate = [t('violation'), t('violations-few'), t('violations')]; + return pluralize(number, translate[0], translate[1], translate[2]); + }; + return ( <>
@@ -196,14 +207,16 @@ export const StackedBarChart = ({ data }: Files) => {
- {t('checks')}: {totalChecks} + {totalChecks} {pluralizeCheks(totalChecks)}
- {t('violations')}: {totalViolations} + {totalViolations} {pluralizeViolations(totalViolations)}
diff --git a/src/app/ui/marking-page/protected-files-table.tsx b/src/app/ui/marking-page/protected-files-table.tsx deleted file mode 100644 index e968f0a..0000000 --- a/src/app/ui/marking-page/protected-files-table.tsx +++ /dev/null @@ -1,150 +0,0 @@ -/* removed */ - -import { IconShield, IconDownload } from '@/app/ui/icons/icons'; -export default function ProtectedFilesTable() { - return ( -
-

- Защищенные изображения (0) -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ФАЙЛРАЗМЕРЗАЩИТАДАТАДЕЙСТВИЯ
-
-
- -
-
-
- Screenshot 2025-11-13 at 10.20.14.p... -
-
- ПОЛНАЯ ЗАЩИТА - - ВСЕ МОДУЛИ - -
-
-
-
- 1.93 МБ - -
-
-
-
- - 100% - -
-
- 27.11.2025 10:16 - - -
-
-
- -
-
-
- Screenshot 2025-11-13 at 10.20.14.p... -
-
- ПОЛНАЯ ЗАЩИТА - - ВСЕ МОДУЛИ - -
-
-
-
- 1.93 МБ - -
-
-
-
- - 100% - -
-
- 27.11.2025 10:16 - - -
-
-
- -
-
-
- Screenshot 2025-11-13 at 10.20.14.p... -
-
- ПОЛНАЯ ЗАЩИТА - - ВСЕ МОДУЛИ - -
-
-
-
- 1.93 МБ - -
-
-
-
- - 100% - -
-
- 27.11.2025 10:16 - - -
-
- ) -} \ No newline at end of file diff --git a/src/app/ui/my-content/my-content-info-block.tsx b/src/app/ui/my-content/my-content-info-block.tsx index 6605984..28f2a24 100644 --- a/src/app/ui/my-content/my-content-info-block.tsx +++ b/src/app/ui/my-content/my-content-info-block.tsx @@ -83,7 +83,7 @@ export default function MyContentInfoBlock() {
-

{t('images')}

+

{t('images-few')}

{fileTypeSizePercents().images}%