add document for tanstak-table filter

This commit is contained in:
smanylov
2026-02-19 18:49:41 +07:00
parent b5d53e0831
commit 81c31547ac
+24
View File
@@ -23,6 +23,7 @@ import { convertBytes } from '@/app/lib/convertBytes';
import { FileInfoModalWindow } from '@/app/ui/modal-windows/file-info-modal-window';
import { FileMonitoringModalWindow } from '@/app/ui/modal-windows/file-monitoring-modal-window';
import { FileTypeIcon } from '@/app/components/FileTypeIcon';
import { fetchReferralUserStats } from '@/app/actions/referralsActions';
type FileType = 'image' | 'video' | 'audio';
@@ -136,6 +137,22 @@ export default function TanstakFilesTable({ fileType }: { fileType: string }) {
},
});
const {
data: referralLink
} = useQuery({
queryKey: ['referralUserStats'],
queryFn: () => {
return fetchReferralUserStats();
},
select: (data) => {
if (data?.referralLink) {
return data?.referralLink;
} else {
return null;
}
}
});
const queryClient = useQueryClient();
// Состояния
@@ -682,6 +699,8 @@ export default function TanstakFilesTable({ fileType }: { fileType: string }) {
return t('videos')
case 'audio':
return t('audios')
case 'document':
return t('documents')
default:
return t('all-types')
}
@@ -701,6 +720,11 @@ export default function TanstakFilesTable({ fileType }: { fileType: string }) {
<li value="audio">
{t('audios')}
</li>
{!referralLink && (
<li value="document">
{t('documents')}
</li>
)}
</DropDownList>
</div>
)}