import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Badge } from "@/components/ui/badge"; import { ArrowUpRight, Calendar, DollarSign, Users, Clock, } from "lucide-react"; import useDashboardStats from "@/hooks/useDashboardStats"; import { formatDistanceToNow } from "date-fns"; import { fr } from "date-fns/locale"; export default function ArtisanStats() { const { totalQuotes, acceptanceRate, totalProjects, completedProjects, totalAppointments, pendingAppointments, totalRevenue, pendingRevenue, recentActivity, isLoading } = useDashboardStats(); // Calculs pour l'affichage const acceptedQuotes = Math.round(totalQuotes * (acceptanceRate / 100)); const pendingQuotes = totalQuotes - acceptedQuotes - 2; // Supposons 2 rejetés const rejectedQuotes = 2; const inProgressProjects = totalProjects - completedProjects; const completedAppointments = totalAppointments - pendingAppointments; if (isLoading) { return
{pendingQuotes} en attente
{inProgressProjects} en cours
{pendingAppointments} à venir
{pendingRevenue.toLocaleString('fr-FR')} € en attente
{activity.title}
{formatDistanceToNow(activity.date, { addSuffix: true, locale: fr })}
Aucune activité récente à afficher.
)}Aucun devis récent à afficher.
Aucun rendez-vous à venir à afficher.
Aucun revenu récent à afficher.