add dashboard statistic

This commit is contained in:
smanylov
2026-05-15 15:31:40 +07:00
parent 80692d6446
commit cce7eb6f96
22 changed files with 972 additions and 176 deletions
+33 -7
View File
@@ -1,14 +1,40 @@
import { QueryClient } from '@tanstack/react-query';
import { fetchTokensGeneralStatistic, fetchProtectedContentGeneralStatistic, fetchTariffStatistic, fetchUserFilesTopStatistic, fetchUserGeneralStatistic, fetchViolationGeneralStatistic } from '@/app/actions/statisticActions';
import { useSubscribeGeneralStatistic } from '@/app/hooks/react-query/dashboard/useSubscribeGeneralStatistic';
export async function prefetchLayoutQueries(queryClient: QueryClient) {
await Promise.all([
queryClient.prefetchQuery({
queryKey: ['userData'],
queryFn: () => {
return {
test: 'testFetchUserData'
}
}
})
queryKey: ['incomeGeneralStatistic'],
queryFn: () => fetchTokensGeneralStatistic()
}),
queryClient.prefetchQuery({
queryKey: ['protectedContentGeneralStatistic'],
queryFn: () => fetchProtectedContentGeneralStatistic()
}),
queryClient.prefetchQuery({
queryKey: ['subscribeGeneralStatistic'],
queryFn: () => useSubscribeGeneralStatistic()
}),
queryClient.prefetchQuery({
queryKey: ['tariffStatistic'],
queryFn: () => fetchTariffStatistic()
}),
queryClient.prefetchQuery({
queryKey: ['tokensGeneralStatistic'],
queryFn: () => fetchTokensGeneralStatistic()
}),
queryClient.prefetchQuery({
queryKey: ['userFilesTopStatistic'],
queryFn: () => fetchUserFilesTopStatistic()
}),
queryClient.prefetchQuery({
queryKey: ['userGeneralStatistic'],
queryFn: () => fetchUserGeneralStatistic()
}),
queryClient.prefetchQuery({
queryKey: ['violationGeneralStatistic'],
queryFn: () => fetchViolationGeneralStatistic()
}),
]);
}