"use client"; import { Users, ScanLine, Bug, AlertTriangle } from "lucide-react"; import StatCard from "@/components/admin/stat-card"; import { Badge } from "@/components/ui/badge"; import { format } from "date-fns"; import { fr } from "date-fns/locale"; interface DashboardProps { stats: { totalUsers: number; scansThisMonth: number; totalDiseases: number; activeAlerts: number; }; recentScans: { id: string; userName: string; diseaseName: string; confidence: number; date: string; }[]; topDiseases: { name: string; count: number }[]; } export default function DashboardClient({ stats, recentScans, topDiseases }: DashboardProps) { const today = format(new Date(), "EEEE d MMMM yyyy", { locale: fr }); const maxCount = topDiseases[0]?.count || 1; return (
{/* Header */}

Tableau de bord

{today}

{/* Stats */}
{/* Recent scans */}

Scans recents

{recentScans.length === 0 ? (

Aucun scan pour le moment

) : ( recentScans.map((scan) => (

{scan.diseaseName}

{scan.userName}

{scan.confidence}% {scan.date}
)) )}
{/* Top diseases */}

Maladies les plus detectees

{topDiseases.length === 0 ? (

Pas assez de donnees

) : ( topDiseases.map((disease, i) => (
{String(i + 1).padStart(2, "0")} {disease.name}
{disease.count}
)) )}
); }