'use client'; import {useQuery} from '@tanstack/react-query'; import {LayoutDashboard, RefreshCw} from 'lucide-react'; import {EmptyStateWithBorder} from '@/components/layout/empty'; import {ErrorInline} from '@/components/layout/error'; import {LoadingStateWithBorder} from '@/components/layout/loading'; import {Button} from '@/components/ui/button'; import {DashboardService} from '@/lib/services/openflare'; import {formatDateTime} from '@/lib/utils'; import {CapacityTrendChart} from './components/dashboard/capacity-trend-chart'; import { SourceDistributionChart, StatusCodeDistributionChart, TopDomainChart, } from './components/dashboard/distribution-rank-charts'; import {NetworkDiskTrendChart} from './components/dashboard/network-disk-trend-chart'; import {NodeHealthTable} from './components/dashboard/node-health-table'; import {TrafficTrendChart} from './components/dashboard/traffic-trend-chart'; import {WorldStage} from './components/dashboard/world-stage'; import {getErrorMessage} from './nodes/components/node-utils'; const dashboardQueryKey = ['openflare', 'dashboard', 'overview']; export default function OpenFlareDashboardPage() { const overviewQuery = useQuery({ queryKey: dashboardQueryKey, queryFn: () => DashboardService.getOverview(), refetchInterval: 30_000, }); const overview = overviewQuery.data; return (