Route analytics access through composable

This commit is contained in:
2026-06-05 11:20:23 +08:00
parent 105efc40d5
commit b6f8d6df18
4 changed files with 21 additions and 8 deletions
+1
View File
@@ -11,3 +11,4 @@ export { useRouteLoading } from './useRouteLoading'
export { useSendFlow } from './useSendFlow'
export { useSystemConfig } from './useSystemConfig'
export { useTheme } from './useTheme'
export { useTransferAnalytics } from './useTransferAnalytics'
+13
View File
@@ -0,0 +1,13 @@
import { StatsService } from '@/services'
import type { AnalyticsData } from '@/types'
export function useTransferAnalytics() {
const fetchAnalytics = async (start?: string, end?: string): Promise<AnalyticsData | null> => {
const response = await StatsService.getAnalytics(start, end)
return response.detail || null
}
return {
fetchAnalytics
}
}