change activity by content info type
This commit is contained in:
@@ -3,16 +3,18 @@
|
|||||||
import { useUserFilesInfo } from '@/app/hooks/react-query/useUserFilesInfo';
|
import { useUserFilesInfo } from '@/app/hooks/react-query/useUserFilesInfo';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { IconImageFile, IconVideoFile, IconAudioFile, IconDocument } from '@/app/ui/icons/icons';
|
import { IconImageFile, IconVideoFile, IconAudioFile, IconDocument } from '@/app/ui/icons/icons';
|
||||||
|
import { useUserSearchData } from '@/app/hooks/react-query/useUserSearchData';
|
||||||
|
|
||||||
export default function ActivityByContentType() {
|
export default function ActivityByContentType() {
|
||||||
const t = useTranslations('Global');
|
const t = useTranslations('Global');
|
||||||
const { data: filesInfo, isLoading, isError, error } = useUserFilesInfo();
|
/* const { data: filesInfo, isLoading, isError, error } = useUserFilesInfo(); */
|
||||||
|
const { data: userSearchData } = useUserSearchData();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="enhanced-chart-container">
|
<div className="enhanced-chart-container">
|
||||||
<div className="enhanced-chart-header">
|
<div className="enhanced-chart-header">
|
||||||
<h3 className="enhanced-chart-title">
|
<h3 className="enhanced-chart-title">
|
||||||
{t('check-activity-by-content-type')}
|
{t('search-activity-by-content-type')}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="search-stats-grid">
|
<div className="search-stats-grid">
|
||||||
@@ -20,7 +22,10 @@ export default function ActivityByContentType() {
|
|||||||
<div className="search-stat-icon">
|
<div className="search-stat-icon">
|
||||||
<IconImageFile />
|
<IconImageFile />
|
||||||
</div>
|
</div>
|
||||||
<div className="search-stat-value">{filesInfo?.images.check ? filesInfo?.images.check : 0}</div>
|
<div className="search-stat-value">
|
||||||
|
{/* {filesInfo?.images.check ? filesInfo?.images.check : 0} */}
|
||||||
|
{userSearchData?.image?.count ? userSearchData?.image?.count : 0}
|
||||||
|
</div>
|
||||||
<div className="search-stat-label">
|
<div className="search-stat-label">
|
||||||
{t('images')}
|
{t('images')}
|
||||||
</div>
|
</div>
|
||||||
@@ -29,7 +34,10 @@ export default function ActivityByContentType() {
|
|||||||
<div className="search-stat-icon">
|
<div className="search-stat-icon">
|
||||||
<IconVideoFile />
|
<IconVideoFile />
|
||||||
</div>
|
</div>
|
||||||
<div className="search-stat-value">{filesInfo?.videos.check ? filesInfo?.videos.check : 0}</div>
|
<div className="search-stat-value">
|
||||||
|
{/* {filesInfo?.videos.check ? filesInfo?.videos.check : 0} */}
|
||||||
|
{userSearchData?.video?.count ? userSearchData?.video?.count : 0}
|
||||||
|
</div>
|
||||||
<div className="search-stat-label">
|
<div className="search-stat-label">
|
||||||
{t('videos')}
|
{t('videos')}
|
||||||
</div>
|
</div>
|
||||||
@@ -38,7 +46,10 @@ export default function ActivityByContentType() {
|
|||||||
<div className="search-stat-icon">
|
<div className="search-stat-icon">
|
||||||
<IconAudioFile />
|
<IconAudioFile />
|
||||||
</div>
|
</div>
|
||||||
<div className="search-stat-value">{filesInfo?.audios.check ? filesInfo?.audios.check : 0}</div>
|
<div className="search-stat-value">
|
||||||
|
{/* {filesInfo?.audios.check ? filesInfo?.audios.check : 0} */}
|
||||||
|
{userSearchData?.audio?.count ? userSearchData?.audio?.count : 0}
|
||||||
|
</div>
|
||||||
<div className="search-stat-label">
|
<div className="search-stat-label">
|
||||||
{t('audios')}
|
{t('audios')}
|
||||||
</div>
|
</div>
|
||||||
@@ -47,7 +58,10 @@ export default function ActivityByContentType() {
|
|||||||
<div className="search-stat-icon">
|
<div className="search-stat-icon">
|
||||||
<IconDocument />
|
<IconDocument />
|
||||||
</div>
|
</div>
|
||||||
<div className="search-stat-value">{filesInfo?.documents.check ? filesInfo?.documents.check : 0}</div>
|
<div className="search-stat-value">
|
||||||
|
{/* {filesInfo?.documents.check ? filesInfo?.documents.check : 0} */}
|
||||||
|
{userSearchData?.document?.count ? userSearchData?.document?.count : 0}
|
||||||
|
</div>
|
||||||
<div className="search-stat-label">
|
<div className="search-stat-label">
|
||||||
{t('documents')}
|
{t('documents')}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -103,6 +103,9 @@ export function FileSearchPanel(
|
|||||||
} else {
|
} else {
|
||||||
setErrorMessage('search-error');
|
setErrorMessage('search-error');
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
await queryClient.invalidateQueries({ queryKey: ['userData'] });
|
||||||
|
await queryClient.invalidateQueries({ queryKey: ['userSearchData'] });
|
||||||
}
|
}
|
||||||
|
|
||||||
}, [fileId])
|
}, [fileId])
|
||||||
@@ -139,8 +142,8 @@ export function FileSearchPanel(
|
|||||||
setGlobalSearchErrorMessage('error');
|
setGlobalSearchErrorMessage('error');
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
await queryClient.invalidateQueries({ queryKey: ['userData'] });
|
/* await queryClient.invalidateQueries({ queryKey: ['userData'] });
|
||||||
await queryClient.invalidateQueries({ queryKey: ['userSearchData'] });
|
await queryClient.invalidateQueries({ queryKey: ['userSearchData'] }); */
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setPaginationLoading(false);
|
setPaginationLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -318,7 +318,7 @@
|
|||||||
"previous": "Previous",
|
"previous": "Previous",
|
||||||
"next": "Next",
|
"next": "Next",
|
||||||
"source": "Source",
|
"source": "Source",
|
||||||
"check-activity-by-content-type": "Check activity by content type",
|
"search-activity-by-content-type": "Search activity by content type",
|
||||||
"summary-statistics": "Summary statistics",
|
"summary-statistics": "Summary statistics",
|
||||||
"general-indicators-of-the-protection-system": "General indicators of the protection system",
|
"general-indicators-of-the-protection-system": "General indicators of the protection system",
|
||||||
"total-number-of-checks": "Total number of checks",
|
"total-number-of-checks": "Total number of checks",
|
||||||
|
|||||||
@@ -318,7 +318,7 @@
|
|||||||
"previous": "Предыдущая",
|
"previous": "Предыдущая",
|
||||||
"next": "Следующая",
|
"next": "Следующая",
|
||||||
"source": "Источник",
|
"source": "Источник",
|
||||||
"check-activity-by-content-type": "Активность проверок по типам контента",
|
"search-activity-by-content-type": "Активность поисков по типам контента",
|
||||||
"summary-statistics": "Итоговая статистика",
|
"summary-statistics": "Итоговая статистика",
|
||||||
"general-indicators-of-the-protection-system": "Общие показатели системы защиты",
|
"general-indicators-of-the-protection-system": "Общие показатели системы защиты",
|
||||||
"total-number-of-checks": "Всего проверок",
|
"total-number-of-checks": "Всего проверок",
|
||||||
|
|||||||
Reference in New Issue
Block a user