import React from 'react'; import { useQuery } from '@tanstack/react-query'; import { FileText, Rss, Users, Route, TrendingUp, Clock, CheckCircle } from 'lucide-react'; import { apiClient } from '../lib/api'; const Dashboard: React.FC = () => { const { data: stats, isLoading, error } = useQuery({ queryKey: ['dashboard-stats'], queryFn: () => apiClient.getDashboardStats(), }); if (isLoading) { return (
{[...Array(4)].map((_, i) => (
))}
); } if (error) { return (

Failed to load dashboard data

); } const articleStats = stats?.article_stats; const systemStats = stats?.system_stats; return (

Dashboard

Overview of your feed management system

{/* Article Statistics */}

Article Statistics

Articles Today

{articleStats?.total_today || 0}

Articles This Week

{articleStats?.total_week || 0}

Approved Today

{articleStats?.approved_today || 0}

Approval Rate

{articleStats?.approval_percentage_today?.toFixed(1) || 0}%

{/* System Statistics */}

System Overview

Active Feeds

{systemStats?.active_feeds || 0} /{systemStats?.total_feeds || 0}

Platform Accounts

{systemStats?.active_platform_accounts || 0} /{systemStats?.total_platform_accounts || 0}

Platform Channels

{systemStats?.active_platform_channels || 0} /{systemStats?.total_platform_channels || 0}

Active Routes

{systemStats?.active_routes || 0} /{systemStats?.total_routes || 0}

); }; export default Dashboard;