'use client'; import { TaskStats } from '@/lib/types'; import { Card } from '@/components/ui/Card'; interface DashboardStatsProps { stats: TaskStats; } export function DashboardStats({ stats }: DashboardStatsProps) { const totalTasks = stats.total; const completionRate = totalTasks > 0 ? Math.round((stats.completed / totalTasks) * 100) : 0; const inProgressRate = totalTasks > 0 ? Math.round((stats.inProgress / totalTasks) * 100) : 0; const statCards = [ { title: 'Total Tâches', value: stats.total, icon: '📋', color: 'bg-blue-500', textColor: 'text-blue-600' }, { title: 'À Faire', value: stats.todo, icon: '⏳', color: 'bg-gray-500', textColor: 'text-gray-600' }, { title: 'En Cours', value: stats.inProgress, icon: '🔄', color: 'bg-orange-500', textColor: 'text-orange-600' }, { title: 'Terminées', value: stats.completed, icon: '✅', color: 'bg-green-500', textColor: 'text-green-600' } ]; return (
{stat.title}
{stat.value}