"use client"; import React from 'react'; import { Users, Store, Clock, MessageCircle, Eye, CheckCircle2, UserPlus } from 'lucide-react'; import Link from 'next/link'; interface DashboardData { stats: { usersCount: number; businessCount: number; pendingCount: number; commentsCount: number; totalViews: number; uniqueVisitors: number; }; latestBusinesses: Array<{ id: string; name: string; category: string; logoUrl: string; location: string; createdAt: Date; verified: boolean; plan: string; owner?: { name: string; email: string; }; }>; activities: Array<{ id: string; type: 'comment' | 'user'; title: string; subtitle: string; timestamp: Date; avatar?: string | null; }>; } export default function DashboardClient({ initialData }: { initialData: DashboardData }) { const { stats, latestBusinesses, activities } = initialData; const statCards = [ { label: 'Utilisateurs', value: stats.usersCount, icon: Users, color: 'text-blue-400' }, { label: 'Visiteurs Uniques', value: stats.uniqueVisitors, icon: Eye, color: 'text-indigo-400' }, { label: 'Entrepreneurs', value: stats.businessCount, icon: Store, color: 'text-emerald-400' }, { label: 'En attente', value: stats.pendingCount, icon: Clock, color: 'text-amber-400' }, { label: 'Commentaires', value: stats.commentsCount, icon: MessageCircle, color: 'text-purple-400' }, { label: 'Total Vues', value: stats.totalViews, icon: Eye, color: 'text-brand-400' }, ]; return (

Tableau de bord

Vue d'ensemble de l'activité sur la plateforme.

{statCards.map((card) => (
{card.value}

{card.label}

))}
{/* Derniers entrepreneurs */}

Derniers entrepreneurs

Voir tout
{latestBusinesses.length === 0 ? (

Aucune entreprise récente.

) : ( latestBusinesses.map((b) => (
{b.logoUrl ? ( {b.name} ) : ( )}
{b.name}
{b.category} • {b.location}
{b.plan} {b.verified ? ( ) : ( )}
)) )}
{/* Activité récente */}

Activité récente

{activities.length === 0 ? (

Aucune activité enregistrée.

) : ( activities.map((act) => (
{act.avatar ? ( ) : act.type === 'comment' ? ( ) : ( )}

{act.title}

{new Date(act.timestamp).toLocaleDateString('fr-FR', { day: 'numeric', month: 'short' })}

{act.subtitle}

)) )}
); }