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