2026-01-14 12:23:07 +07:00
|
|
|
'use client'
|
|
|
|
|
|
|
|
|
|
import { useTranslations } from 'next-intl';
|
|
|
|
|
import {convertBytes} from '@/app/lib/convertBytes';
|
2026-02-13 12:50:58 +07:00
|
|
|
import {useUserFilesInfo} from '@/app/hooks/react-query/useUserFilesInfo';
|
2026-01-14 12:23:07 +07:00
|
|
|
|
2026-01-13 15:29:34 +07:00
|
|
|
export default function DashboardFilesInfo() {
|
2026-01-14 12:23:07 +07:00
|
|
|
const t = useTranslations("Global");
|
2026-02-13 12:50:58 +07:00
|
|
|
const { data: filesInfo, isLoading, isError, error } = useUserFilesInfo();
|
2026-01-14 12:23:07 +07:00
|
|
|
|
2026-01-13 15:29:34 +07:00
|
|
|
return (
|
|
|
|
|
<div className="dashboard-files-info">
|
2026-01-14 12:23:07 +07:00
|
|
|
<div className="type-card images">
|
|
|
|
|
<div className="stat-type">
|
|
|
|
|
{t('images')}
|
|
|
|
|
</div>
|
2026-02-13 12:50:58 +07:00
|
|
|
<div className="stat-value">{filesInfo?.images.quantity ? filesInfo?.images.quantity : 0}</div>
|
2026-01-14 12:23:07 +07:00
|
|
|
<div className="stat-label">{t('your-image')}</div>
|
2026-01-13 15:29:34 +07:00
|
|
|
<div className="type-card-stats">
|
|
|
|
|
<div className="type-card-stat-row">
|
2026-01-14 12:23:07 +07:00
|
|
|
<span className="type-card-stat-label">{t('size')}</span>
|
2026-02-13 12:50:58 +07:00
|
|
|
<span className="type-card-stat-value">{filesInfo?.images.size ? convertBytes(filesInfo?.images.size) : 0}</span>
|
2026-01-13 15:29:34 +07:00
|
|
|
</div>
|
|
|
|
|
<div className="type-card-stat-row">
|
2026-01-26 16:09:39 +07:00
|
|
|
<span className="type-card-stat-label">{t('PROTECTED')}</span>
|
2026-02-13 12:50:58 +07:00
|
|
|
<span className="type-card-stat-value">{filesInfo?.images.protected ? filesInfo?.images.protected : 0}</span>
|
2026-01-13 15:29:34 +07:00
|
|
|
</div>
|
|
|
|
|
<div className="type-card-stat-row">
|
2026-01-14 12:23:07 +07:00
|
|
|
<span className="type-card-stat-label">{t('violations')}</span>
|
2026-02-13 12:50:58 +07:00
|
|
|
<span className="type-card-stat-value">{filesInfo?.images.violation ? filesInfo?.images.violation : 0}</span>
|
2026-01-13 15:29:34 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-01-14 12:23:07 +07:00
|
|
|
<div className="type-card videos">
|
|
|
|
|
<div className="stat-type">
|
|
|
|
|
{t('videos')}
|
|
|
|
|
</div>
|
2026-02-13 12:50:58 +07:00
|
|
|
<div className="stat-value">{filesInfo?.videos.quantity ? filesInfo?.videos.quantity : 0}</div>
|
2026-01-14 12:23:07 +07:00
|
|
|
<div className="stat-label">{t('your-videos')}</div>
|
2026-01-13 15:29:34 +07:00
|
|
|
<div className="type-card-stats">
|
|
|
|
|
<div className="type-card-stat-row">
|
2026-01-14 12:23:07 +07:00
|
|
|
<span className="type-card-stat-label">{t('size')}</span>
|
2026-02-13 12:50:58 +07:00
|
|
|
<span className="type-card-stat-value">{filesInfo?.videos.size ? convertBytes(filesInfo?.videos.size) : 0}</span>
|
2026-01-13 15:29:34 +07:00
|
|
|
</div>
|
|
|
|
|
<div className="type-card-stat-row">
|
2026-01-26 16:09:39 +07:00
|
|
|
<span className="type-card-stat-label">{t('PROTECTED')}</span>
|
2026-02-13 12:50:58 +07:00
|
|
|
<span className="type-card-stat-value">{filesInfo?.videos.protected ? filesInfo?.videos.protected : 0}</span>
|
2026-01-13 15:29:34 +07:00
|
|
|
</div>
|
|
|
|
|
<div className="type-card-stat-row">
|
2026-01-14 12:23:07 +07:00
|
|
|
<span className="type-card-stat-label">{t('violations')}</span>
|
2026-02-13 12:50:58 +07:00
|
|
|
<span className="type-card-stat-value">{filesInfo?.videos.violation ? filesInfo?.videos.violation : 0}</span>
|
2026-01-13 15:29:34 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-01-14 12:23:07 +07:00
|
|
|
<div className="type-card audio">
|
|
|
|
|
<div className="stat-type">
|
|
|
|
|
{t('audios')}
|
|
|
|
|
</div>
|
2026-02-13 12:50:58 +07:00
|
|
|
<div className="stat-value">{filesInfo?.audios.quantity ? filesInfo?.audios.quantity : 0}</div>
|
2026-01-14 12:23:07 +07:00
|
|
|
<div className="stat-label">{t('your-audios')}</div>
|
2026-01-13 15:29:34 +07:00
|
|
|
<div className="type-card-stats">
|
|
|
|
|
<div className="type-card-stat-row">
|
2026-01-14 12:23:07 +07:00
|
|
|
<span className="type-card-stat-label">{t('size')}</span>
|
2026-02-13 12:50:58 +07:00
|
|
|
<span className="type-card-stat-value">{filesInfo?.audios.size ? convertBytes(filesInfo?.audios.size) : 0}</span>
|
2026-01-13 15:29:34 +07:00
|
|
|
</div>
|
|
|
|
|
<div className="type-card-stat-row">
|
2026-01-26 16:09:39 +07:00
|
|
|
<span className="type-card-stat-label">{t('PROTECTED')}</span>
|
2026-02-13 12:50:58 +07:00
|
|
|
<span className="type-card-stat-value">{filesInfo?.audios.protected ? filesInfo?.audios.protected : 0}</span>
|
2026-01-13 15:29:34 +07:00
|
|
|
</div>
|
|
|
|
|
<div className="type-card-stat-row">
|
2026-01-14 12:23:07 +07:00
|
|
|
<span className="type-card-stat-label">{t('violations')}</span>
|
2026-02-13 12:50:58 +07:00
|
|
|
<span className="type-card-stat-value">{filesInfo?.audios.violation ? filesInfo?.audios.violation : 0}</span>
|
2026-01-13 15:29:34 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-01-14 12:23:07 +07:00
|
|
|
<div className="type-card scripts">
|
|
|
|
|
<div className="stat-type">
|
|
|
|
|
{t('documents')}
|
|
|
|
|
</div>
|
2026-02-13 12:50:58 +07:00
|
|
|
<div className="stat-value">{filesInfo?.documents.quantity ? filesInfo?.documents.quantity : 0}</div>
|
2026-01-14 12:23:07 +07:00
|
|
|
<div className="stat-label">{t('your-documents')}</div>
|
2026-01-13 15:29:34 +07:00
|
|
|
<div className="type-card-stats">
|
|
|
|
|
<div className="type-card-stat-row">
|
2026-01-14 12:23:07 +07:00
|
|
|
<span className="type-card-stat-label">{t('size')}</span>
|
2026-02-13 12:50:58 +07:00
|
|
|
<span className="type-card-stat-value">{filesInfo?.documents.check? convertBytes(filesInfo?.documents.check) : 0}</span>
|
2026-01-13 15:29:34 +07:00
|
|
|
</div>
|
|
|
|
|
<div className="type-card-stat-row">
|
2026-01-26 16:09:39 +07:00
|
|
|
<span className="type-card-stat-label">{t('PROTECTED')}</span>
|
2026-02-13 12:50:58 +07:00
|
|
|
<span className="type-card-stat-value">{filesInfo?.documents.protected ? filesInfo?.documents.protected : 0}</span>
|
2026-01-13 15:29:34 +07:00
|
|
|
</div>
|
|
|
|
|
<div className="type-card-stat-row">
|
2026-01-14 12:23:07 +07:00
|
|
|
<span className="type-card-stat-label">{t('violations')}</span>
|
2026-02-13 12:50:58 +07:00
|
|
|
<span className="type-card-stat-value">{filesInfo?.documents.violation ? filesInfo?.documents.violation : 0}</span>
|
2026-01-13 15:29:34 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|