change violations statisctic greed
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "no-copy-frontend",
|
"name": "no-copy-frontend",
|
||||||
"version": "0.22.0",
|
"version": "0.23.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 2999",
|
"dev": "next dev -p 2999",
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import PageTitleColorFrame from '@/app/ui/page-title-color-frame';
|
import PageTitleColorFrame from '@/app/ui/page-title-color-frame';
|
||||||
import ProtectionStatistic from '@/app/ui/marking-page/new/protection-statistic';
|
|
||||||
import DahboardGeographySection from '@/app/ui/dashboard/new/dashboard-geography-section';
|
import DahboardGeographySection from '@/app/ui/dashboard/new/dashboard-geography-section';
|
||||||
import DashboardPlatformsList from '@/app/ui/dashboard/new/dashboard-platforms-list';
|
import DashboardPlatformsList from '@/app/ui/dashboard/new/dashboard-platforms-list';
|
||||||
import ViolationsMyCases from '@/app/ui/violations/violations-my-cases';
|
import ViolationsMyCases from '@/app/ui/violations/violations-my-cases';
|
||||||
import ViolationsCheckAllSection from '@/app/ui/violations/violations-check-all-section';
|
import ViolationsCheckAllSection from '@/app/ui/violations/violations-check-all-section';
|
||||||
import ViolationsTable from '@/app/ui/violations/violations-table';
|
import ViolationsTable from '@/app/ui/violations/violations-table';
|
||||||
|
import ViolationsStatistic from '@/app/ui/violations/violations-statistic';
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
const FILE_TYPE = "all";
|
const FILE_TYPE = "all";
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ export default function Page() {
|
|||||||
title="monitoring-copyright-infringements"
|
title="monitoring-copyright-infringements"
|
||||||
description="monitoring-copyright-infringements-description"
|
description="monitoring-copyright-infringements-description"
|
||||||
/>
|
/>
|
||||||
<ProtectionStatistic fileType={FILE_TYPE} />
|
<ViolationsStatistic />
|
||||||
<ViolationsMyCases />
|
<ViolationsMyCases />
|
||||||
<ViolationsCheckAllSection />
|
<ViolationsCheckAllSection />
|
||||||
<ViolationsTable />
|
<ViolationsTable />
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
'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';
|
||||||
|
|
||||||
|
type FilesInfo = {
|
||||||
|
totalSize: number;
|
||||||
|
totalCount: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function ViolationsStatistic() {
|
||||||
|
const t = useTranslations('Global');
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: filesInfo,
|
||||||
|
isLoading,
|
||||||
|
isError,
|
||||||
|
error,
|
||||||
|
} = useQuery<{
|
||||||
|
all_files_size: number,
|
||||||
|
all_files_quantity: number
|
||||||
|
}, Error, FilesInfo>({
|
||||||
|
queryKey: ['userFilesInfo'],
|
||||||
|
queryFn: getUserFilesInfo,
|
||||||
|
select: (data): FilesInfo => {
|
||||||
|
if (!data) {
|
||||||
|
return {
|
||||||
|
totalSize: 0,
|
||||||
|
totalCount: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
totalSize: data.all_files_size,
|
||||||
|
totalCount: data.all_files_quantity
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="protection-statistic">
|
||||||
|
<div className="protection-statistic-stat-card">
|
||||||
|
<div className="protection-statistic-stat-number">0</div>
|
||||||
|
<div className="protection-statistic-stat-label">{t(`total-violations`)}</div>
|
||||||
|
</div>
|
||||||
|
<div className="protection-statistic-stat-card">
|
||||||
|
<div className="protection-statistic-stat-number">0</div>
|
||||||
|
<div className="protection-statistic-stat-label">{t(`new`)}</div>
|
||||||
|
</div>
|
||||||
|
<div className="protection-statistic-stat-card">
|
||||||
|
<div className="protection-statistic-stat-number">
|
||||||
|
0
|
||||||
|
</div>
|
||||||
|
<div className="protection-statistic-stat-label">{t(`in-progress`)}</div>
|
||||||
|
</div>
|
||||||
|
<div className="protection-statistic-stat-card">
|
||||||
|
<div className="protection-statistic-stat-number">0</div>
|
||||||
|
<div className="protection-statistic-stat-label">{t('it-decided')}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -190,7 +190,11 @@
|
|||||||
"image-occupy": "Occupied by Images",
|
"image-occupy": "Occupied by Images",
|
||||||
"video-occupy": "Occupied by Videos",
|
"video-occupy": "Occupied by Videos",
|
||||||
"audio-occupy": "Occupied by Audio",
|
"audio-occupy": "Occupied by Audio",
|
||||||
"violations-found": "Violations found"
|
"violations-found": "Violations found",
|
||||||
|
"total-violations": "Total violations",
|
||||||
|
"new": "new",
|
||||||
|
"in-progress": "In progress",
|
||||||
|
"it-decided": "It's decided"
|
||||||
},
|
},
|
||||||
"Login-register-form": {
|
"Login-register-form": {
|
||||||
"and": "and",
|
"and": "and",
|
||||||
|
|||||||
@@ -190,7 +190,11 @@
|
|||||||
"image-occupy": "Занимают изображения",
|
"image-occupy": "Занимают изображения",
|
||||||
"video-occupy": "Занимают видео",
|
"video-occupy": "Занимают видео",
|
||||||
"audio-occupy": "Занимают аудио",
|
"audio-occupy": "Занимают аудио",
|
||||||
"violations-found": "Найдено нарушений"
|
"violations-found": "Найдено нарушений",
|
||||||
|
"total-violations": "Всего нарушений",
|
||||||
|
"new": "Новые",
|
||||||
|
"in-progress": "В работе",
|
||||||
|
"it-decided": "Решено"
|
||||||
},
|
},
|
||||||
"Login-register-form": {
|
"Login-register-form": {
|
||||||
"and": "и",
|
"and": "и",
|
||||||
|
|||||||
Reference in New Issue
Block a user