diff --git a/frontend/admin-web/src/views/dashboard/DashboardPage.tsx b/frontend/admin-web/src/views/dashboard/DashboardPage.tsx index a3c47a0..4d78ba0 100644 --- a/frontend/admin-web/src/views/dashboard/DashboardPage.tsx +++ b/frontend/admin-web/src/views/dashboard/DashboardPage.tsx @@ -46,8 +46,10 @@ const loadingBox: React.CSSProperties = { export const DashboardPage: React.FC = () => { const { data: statsData, isLoading: statsLoading, error: statsError } = useApi('/api/v1/admin/dashboard/stats'); - const { data: tradesData, isLoading: tradesLoading } = useApi('/api/v1/admin/dashboard/realtime-trades'); - const { data: healthData, isLoading: healthLoading } = useApi('/api/v1/admin/dashboard/system-health'); + const { data: tradesResp, isLoading: tradesLoading } = useApi<{ items: RealtimeTrade[]; total: number }>('/api/v1/admin/dashboard/realtime-trades'); + const { data: healthResp, isLoading: healthLoading } = useApi<{ services: ServiceHealth[] }>('/api/v1/admin/dashboard/system-health'); + const tradesData = tradesResp?.items ?? []; + const healthData = healthResp?.services ?? []; const formatNumber = (n: number) => n?.toLocaleString() ?? '-'; const formatCurrency = (n: number) => `$${n?.toLocaleString() ?? '0'}`; @@ -185,7 +187,7 @@ export const DashboardPage: React.FC = () => { - {(tradesData ?? []).map((row, i) => ( + {tradesData.map((row, i) => ( {row.time} {row.type} @@ -219,7 +221,7 @@ export const DashboardPage: React.FC = () => {
{t('dashboard_system_health')}
{healthLoading ? (
Loading...
- ) : (healthData ?? []).map(service => ( + ) : healthData.map(service => (