import { useNavigate } from 'react-router-dom'; import { FolderKanban, TrendingUp, CheckSquare, CloudSun } from 'lucide-react'; import { Card, CardContent } from '@/components/ui/card'; interface StatsWidgetProps { projectStats: { total: number; by_status: Record; }; totalIncompleteTodos: number; weatherData?: { temp: number; description: string; city?: string } | null; } export default function StatsWidget({ projectStats, totalIncompleteTodos, weatherData }: StatsWidgetProps) { const navigate = useNavigate(); const statCards = [ { label: 'PROJECTS', value: projectStats.total, icon: FolderKanban, color: 'text-blue-400', glowBg: 'bg-blue-500/10', onClick: () => navigate('/projects'), }, { label: 'IN PROGRESS', value: projectStats.by_status['in_progress'] || 0, icon: TrendingUp, color: 'text-purple-400', glowBg: 'bg-purple-500/10', onClick: () => navigate('/projects', { state: { filter: 'in_progress' } }), }, { label: 'OPEN TODOS', value: totalIncompleteTodos, icon: CheckSquare, color: 'text-teal-400', glowBg: 'bg-teal-500/10', onClick: () => navigate('/todos'), }, ]; return (
{statCards.map((stat) => (

{stat.label}

{stat.value}

))} {/* Weather card */}

WEATHER

{weatherData ? (

{weatherData.temp}°

{weatherData.description} {weatherData.city && ( · {weatherData.city} )}
) : (

)}
); }