From e53a85caa2bfb5936d687f2f469bfbc64ef1707d Mon Sep 17 00:00:00 2001 From: smanylov Date: Wed, 14 Jan 2026 12:48:33 +0700 Subject: [PATCH] reafactor --- src/app/[locale]/pages/dashboard/page.tsx | 5 +--- src/app/[locale]/pages/dashboard1/page.tsx | 3 +- src/app/[locale]/pages/refferals/page.tsx | 3 +- src/app/[locale]/pages/reports/page.tsx | 3 +- src/app/[locale]/pages/settings/page.tsx | 3 +- .../ui/dashboard/new/dashboard-user-stats.tsx | 29 ++++++++++++++++--- 6 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/app/[locale]/pages/dashboard/page.tsx b/src/app/[locale]/pages/dashboard/page.tsx index 7787195..32fc157 100644 --- a/src/app/[locale]/pages/dashboard/page.tsx +++ b/src/app/[locale]/pages/dashboard/page.tsx @@ -1,7 +1,5 @@ import { Metadata } from 'next'; import { Suspense } from 'react'; -import ProtectionOverview from '@/app/ui/dashboard/protection-overview'; -import StatsGrid from '@/app/ui/dashboard/stats-grid'; import { useTranslations } from 'next-intl'; import FilesTable from '@/app/ui/dashboard/files-table'; import PageTitle from '@/app/ui/page-title'; @@ -23,8 +21,7 @@ export default function Page() { return ( ...}> - - +
diff --git a/src/app/[locale]/pages/dashboard1/page.tsx b/src/app/[locale]/pages/dashboard1/page.tsx index c51cefd..6f6b48f 100644 --- a/src/app/[locale]/pages/dashboard1/page.tsx +++ b/src/app/[locale]/pages/dashboard1/page.tsx @@ -16,8 +16,7 @@ export default function Page() { return ( <> ...}> - - +
diff --git a/src/app/[locale]/pages/refferals/page.tsx b/src/app/[locale]/pages/refferals/page.tsx index 1159679..78bf347 100644 --- a/src/app/[locale]/pages/refferals/page.tsx +++ b/src/app/[locale]/pages/refferals/page.tsx @@ -13,8 +13,7 @@ export default function Page() { return ( ...}> - - + diff --git a/src/app/[locale]/pages/reports/page.tsx b/src/app/[locale]/pages/reports/page.tsx index 8ae86ab..dabb6fd 100644 --- a/src/app/[locale]/pages/reports/page.tsx +++ b/src/app/[locale]/pages/reports/page.tsx @@ -9,8 +9,7 @@ import PageTitle from '@/app/ui/page-title'; export default function Page() { return (
- - +
diff --git a/src/app/[locale]/pages/settings/page.tsx b/src/app/[locale]/pages/settings/page.tsx index 48f0e10..cfa3abb 100644 --- a/src/app/[locale]/pages/settings/page.tsx +++ b/src/app/[locale]/pages/settings/page.tsx @@ -13,8 +13,7 @@ export default function Page() { return ( <> - - +
diff --git a/src/app/ui/dashboard/new/dashboard-user-stats.tsx b/src/app/ui/dashboard/new/dashboard-user-stats.tsx index f30a664..3516ee8 100644 --- a/src/app/ui/dashboard/new/dashboard-user-stats.tsx +++ b/src/app/ui/dashboard/new/dashboard-user-stats.tsx @@ -1,31 +1,52 @@ +'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'; + export default function DashboardUserStats() { + const t = useTranslations("Global"); + + const { + data: filesInfo, + isLoading, + isError, + error, + } = useQuery({ + queryKey: ['userFilesInfo'], + queryFn: getUserFilesInfo, + }); + return (
ЗАЩИЩЁННЫЕ ФАЙЛЫ
-
367
+
0
Файлов под защитой
🛡️
СОВПАДЕНИЯ
-
520
+
0
Найдено совпадений
🔍
НАРУШЕНИЯ
-
499
+
{filesInfo.all_files_violations ? filesInfo.all_files_violations : 0}
Требуют внимания
⚠️
ХРАНИЛИЩЕ
-
790.2 MB
+
+ {filesInfo.all_files_size ? convertBytes(filesInfo.all_files_size) : 0} +
Использовано места
💾