From 6ccdfc01299fe842df9023d406668f91e3526cd7 Mon Sep 17 00:00:00 2001 From: smanylov Date: Thu, 12 Feb 2026 13:11:14 +0700 Subject: [PATCH] add reports-info --- src/app/[locale]/pages/reports/page.tsx | 4 +- src/app/ui/reports/reports-info.tsx | 57 +++++++++++++++++++++++++ src/i18n/messages/en.json | 5 ++- src/i18n/messages/ru.json | 5 ++- 4 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 src/app/ui/reports/reports-info.tsx diff --git a/src/app/[locale]/pages/reports/page.tsx b/src/app/[locale]/pages/reports/page.tsx index dabb6fd..edf6d9c 100644 --- a/src/app/[locale]/pages/reports/page.tsx +++ b/src/app/[locale]/pages/reports/page.tsx @@ -5,12 +5,14 @@ import AnalyticsCardMonth from '@/app/ui/reports/analytics-card-month'; import AnalyticsCardGeography from '@/app/ui/reports/analytics-carв-geography'; import ActivityByContentType from '@/app/ui/reports/activity-by-content-type'; import PageTitle from '@/app/ui/page-title'; +import ReportsInfo from '@/app/ui/reports/reports-info'; export default function Page() { return (
- + {/* */} +
diff --git a/src/app/ui/reports/reports-info.tsx b/src/app/ui/reports/reports-info.tsx new file mode 100644 index 0000000..837a1e2 --- /dev/null +++ b/src/app/ui/reports/reports-info.tsx @@ -0,0 +1,57 @@ +'use client' + +import { useTranslations } from 'next-intl'; +import { useQuery } from '@tanstack/react-query'; +import { getUserFilesInfo } from '@/app/actions/action'; +import {convertBytes} from '@/app/lib/convertBytes'; +import { useEffect } from 'react'; + +export default function ReportsInfo() { + const t = useTranslations("Global"); + + const { + data: filesInfo, + isLoading, + isError, + error, + } = useQuery({ + queryKey: ['userFilesInfo'], + queryFn: getUserFilesInfo, + }); + + useEffect(() => { + console.log(filesInfo) + }, [filesInfo]) + + return ( +
+
+
+ {t('all-content')} +
+
{filesInfo?.all_files_quantity ? filesInfo?.all_files_quantity : 0}
+
+ +
+
+ {t('violations-few')} +
+
{filesInfo?.all_files_violation ? filesInfo?.all_files_violation : 0}
+
+ +
+
+ {t('monitoring')} +
+
{filesInfo?.all_files_check ? filesInfo?.all_files_check : 0}
+
+ +
+
+ {t('efficiency')} +
+
100%
+
+
+ ) +} \ No newline at end of file diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index 2dd1a7a..cdfce60 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -220,7 +220,10 @@ "remove": "Remove", "start-upload": "Start upload", "completed": "Completed", - "pending": "Pending" + "pending": "Pending", + "all-content": "All content", + "monitoring": "Monitoring", + "efficiency": "Efficiency" }, "Login-register-form": { "and": "and", diff --git a/src/i18n/messages/ru.json b/src/i18n/messages/ru.json index 0aa8ad0..c37ea2e 100644 --- a/src/i18n/messages/ru.json +++ b/src/i18n/messages/ru.json @@ -220,7 +220,10 @@ "remove": "Удалить", "start-upload": "Начать загрузку", "completed": "Завершено", - "pending": "В ожидании" + "pending": "В ожидании", + "all-content": "Весь контент", + "monitoring": "Мониторинг", + "efficiency": "Эффективность" }, "Login-register-form": { "and": "и",