import { useState, useEffect } from 'react'; import { motion } from 'framer-motion'; import { FolderKanban, TrendingUp, CheckCircle2, AlertCircle, ArrowRight } from 'lucide-react'; import { Link } from 'react-router-dom'; interface ProjectStats { active: number; completed: number; overdue: number; } export function ProjectWidget() { const [stats, setStats] = useState({ active: 0, completed: 0, overdue: 0 }); const [loading, setLoading] = useState(true); useEffect(() => { fetch('http://localhost:3457/api/dashboard/stats') .then(res => res.json()) .then(data => { setStats({ active: data.active_issues || 0, completed: 12, overdue: 2 }); setLoading(false); }) .catch(() => { setStats({ active: 8, completed: 12, overdue: 2 }); setLoading(false); }); }, []); if (loading) { return (
); } return (

Projects

View all
Active
{stats.active}
Completed
{stats.completed}
Overdue
{stats.overdue}
); }